-
-
Save alopix/2524414fd075d4fb7a32f00bc80400ef to your computer and use it in GitHub Desktop.
A TypeScript type definition for NPM package files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface PackageJson { | |
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; | |
} | |
export interface Author { | |
name: string; | |
email?: string; | |
homepage?: string; | |
} | |
export interface BinMap { | |
[commandName: string]: string; | |
} | |
export interface Bugs { | |
email: string; | |
url: string; | |
} | |
export interface Config { | |
name?: string; | |
config?: Object; | |
} | |
export interface DependencyMap { | |
[dependencyName: string]: string; | |
} | |
export interface Directories { | |
lib?: string; | |
bin?: string; | |
man?: string; | |
doc?: string; | |
example?: string; | |
} | |
export interface Engines { | |
node?: string; | |
npm?: string; | |
} | |
export interface PublishConfig { | |
registry?: string; | |
} | |
export interface Repository { | |
type: string; | |
url: string; | |
} | |
export interface ScriptsMap { | |
[scriptName: string]: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "@types/gist-package-json", | |
"version": "1.0.0", | |
"author": "Iain Reid", | |
"contributors": ["Dustin Steiner <[email protected]>"] | |
"types": "package-json.d.ts" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"authors": "Iain Reid", | |
"contributors": ["Dustin Steiner <[email protected]>"] | |
"definitionFilename": "package-json.d.ts", | |
"sourceRepoURL": "https://gist.github.com/iainreid820/5c1cc527fe6b5b7dba41fec7fe54bf6e", | |
"declaredModules": [ | |
"PackageJSON", | |
"Author", | |
"BinMap", | |
"Bugs", | |
"Config", | |
"DependencyMap", | |
"Directories", | |
"Engines", | |
"PublishConfig", | |
"Repository", | |
"ScriptsMap" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment