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,19 +2,21 @@
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", "name": "expo",
"description": "", "description": "My package",
"keywords": [""],
"author": "Rico Sta. Cruz <hi@ricostacruz.com>",
"version": "0.1.0", "version": "0.1.0",
"license": "MIT",
"keywords": ["http", "server"],
"author": "Rico Sta. Cruz <hi@ricostacruz.com>",
"engines": { "engines": {
"node": ">=0.8.0" "node": ">=0.8.0"
}, },
@ -26,40 +28,54 @@ redirect_from:
"type": "git", "type": "git",
"url": "https://github.com/rstacruz/___.git" "url": "https://github.com/rstacruz/___.git"
}, },
"license": "MIT" }
} ```
{: 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
"scripts": {
"start": "node ./bin/xxx", /* npm start */ "start": "node ./bin/xxx", /* npm start */
"test": "vows --spec --isolate", /* npm test */ "test": "vows --spec --isolate", /* npm test */
"postinstall": "...", "postinstall": "...",
"prepublish": "grunt build", /* after 'npm install' and before 'npm "prepublish": "grunt build", /* after 'npm install' and before 'npm
publish' */ 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
---