···11Node.js packages
22================
33-To add a package from [NPM](https://www.npmjs.com/) to nixpkgs:
33+The `pkgs/development/node-packages` folder contains a generated collection of
44+[NPM packages](https://npmjs.com/) that can be installed with the Nix package
55+manager.
66+77+As a rule of thumb, the package set should only provide *end user* software
88+packages, such as command-line utilities. Libraries should only be added to the
99+package set if there is a non-NPM package that requires it.
1010+1111+When it is desired to use NPM libraries in a development project, use the
1212+`node2nix` generator directly on the `package.json` configuration file of the
1313+project.
1414+1515+The package set also provides support for multiple Node.js versions. The policy
1616+is that a new package should be added to the collection for the latest stable LTS
1717+release (which is currently 6.x), unless there is an explicit reason to support
1818+a different release.
1919+2020+To add a package from NPM to nixpkgs:
421522 1. Modify `pkgs/development/node-packages/node-packages-v6.json` to add, update
623 or remove package entries. (Or `pkgs/development/node-packages/node-packages-v4.json`
77- for packagages depending on Node.js 4.x)
2424+ for packages depending on Node.js 4.x)
825 2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`.
926 3. Build your new package to test your changes:
1027 `cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
1128 To build against a specific Node.js version (e.g. 4.x):
1229 `nix-build -A nodePackages_4_x.<new-or-updated-package>`
1330 4. Add and commit all modified and generated files.
3131+3232+For more information about the generation process, consult the
3333+[README.md](https://github.com/svanderburg/node2nix) file of the `node2nix`
3434+tool.