package.json: update

This commit is contained in:
Rico Sta. Cruz 2017-08-30 19:00:41 +08:00
parent eae4ced525
commit 489b520729
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
3 changed files with 66 additions and 43 deletions

View File

@ -29,7 +29,7 @@ Jekyll
* jekyll-sitemap * jekyll-sitemap
{: .-four-column} {: .-four-column}
As of github-pages v156. As of github-pages v156. For an updated list, see: [Dependency versions](https://pages.github.com/versions/) _(pages.github.com)_
GitHub Metadata GitHub Metadata
--------------- ---------------

View File

@ -2,64 +2,80 @@
title: package.json title: package.json
category: Node.js category: Node.js
layout: 2017/sheet layout: 2017/sheet
redirect_from: prism_languages: [json]
- /package.html updated: 201708.30
- /package weight: -3
--- ---
### Basic ### Basic
{ ```json
"name": "expo", {
"description": "", "name": "expo",
"keywords": [""], "description": "My package",
"author": "Rico Sta. Cruz <hi@ricostacruz.com>", "version": "0.1.0",
"version": "0.1.0", "license": "MIT",
"engines": { "keywords": ["http", "server"],
"node": ">=0.8.0" "author": "Rico Sta. Cruz <hi@ricostacruz.com>",
}, "engines": {
"main": "index", "node": ">=0.8.0"
"bin": { },
"command": "./bin/command" "main": "index",
}, "bin": {
"repository": { "command": "./bin/command"
"type": "git", },
"url": "https://github.com/rstacruz/___.git" "repository": {
}, "type": "git",
"license": "MIT" "url": "https://github.com/rstacruz/___.git"
} },
}
```
{: data-line="2,3,4,5"}
Highlighted lines are required.
### Dependencies ### Dependencies
"dependencies": { ```json
"colors" : "*", "dependencies": {
"flatiron" : "0.1.x", "colors": "*",
"flatiron" : "~0.1.0", "flatiron": "0.1.x",
"plates" : "https://github.com/user/project/tarball/branch", "flatiron": "~0.1.0",
"stuff" : "git://github.com/user/project.git#commit-ish" "plates": "https://github.com/user/project/tarball/branch",
}, "stuff": "git://github.com/user/project.git#commit-ish"
"devDependencies": { },
... ```
},
```json
"devDependencies": { ··· },
"peerDependencies": { ··· },
"optionalDependencies": { ··· },
```
See [Semver cheatsheet](./semver) for explanation of version ranges.
### Scripts ### Scripts
"scripts": { ```json
"start": "node ./bin/xxx", /* npm start */ "scripts": {
"test": "vows --spec --isolate", /* npm test */ "start": "node ./bin/xxx", /* npm start */
"postinstall": "...", "test": "vows --spec --isolate", /* npm test */
"prepublish": "grunt build", /* after 'npm install' and before 'npm "postinstall": "...",
publish' */ "prepublish": "grunt build", /* after 'npm install' and before 'npm
} publish' */
}
```
### Misc ### Misc
"private": true, ```json
"preferGlobal": true "private": true,
"preferGlobal": true
```
### Config ### Config
```js ```json
{ {
"config": { "config": {
"foobar": "hello" "foobar": "hello"
@ -70,6 +86,8 @@ redirect_from:
} }
``` ```
Keys in `config` are exposed as env vars to scripts.
## References ## References
{: .-one-column} {: .-one-column}

5
package.md Normal file
View File

@ -0,0 +1,5 @@
---
title: package.json
category: Hidden
redirect_to: /package.json
---