Skip to content

Instantly share code, notes, and snippets.

@mathieutu
Last active January 22, 2023 01:12
Show Gist options
  • Save mathieutu/9fc1bd36a453b41f9e05190d8cb53643 to your computer and use it in GitHub Desktop.
Save mathieutu/9fc1bd36a453b41f9e05190d8cb53643 to your computer and use it in GitHub Desktop.
PackageJson Typescript definitions.
export interface PackageJSON extends Object {
name: string
version?: string
description?: string
keywords?: string[]
homepage?: string
bugs?: string | Bugs
license?: string
author?: string | Author
contributors?: string[] | Author[]
files?: string[]
main?: string
bin?: string | BinMap
man?: string | string[]
directories?: Directories
repository?: string | Repository
scripts?: ScriptsMap
config?: Config
dependencies?: DependencyMap
devDependencies?: DependencyMap
peerDependencies?: DependencyMap
optionalDependencies?: DependencyMap
bundledDependencies?: string[]
engines?: Engines
os?: string[]
cpu?: string[]
preferGlobal?: boolean
private?: boolean
publishConfig?: PublishConfig
}
interface Author {
name: string
email?: string
homepage?: string
}
interface BinMap {
[commandName: string]: string
}
interface Bugs {
email: string
url: string
}
interface Config {
name?: string
config?: Object
}
interface DependencyMap {
[dependencyName: string]: string
}
interface Directories {
lib?: string
bin?: string
man?: string
doc?: string
example?: string
}
interface Engines {
node?: string
npm?: string
yarn?: string
}
interface PublishConfig {
registry?: string
}
interface Repository {
type: string
url: string
}
interface ScriptsMap {
[scriptName: string]: string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment