node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »


Sample projects structure

+-- dist // target folder
+-- src
|   +-- package.json // module package.json
package.json // root package.json
  1. Safety: add "private":true to your root package.json

  2. Module package.json (see sample project structure above) should contain dependencies and peerDepencies of module, sample:

  "name": "ng2-bootstrap",
  "dependencies": {
    "moment": "*"
  "peerDependencies": {
    "@angular/common": "*",
    "@angular/compiler": "*",
    "@angular/core": "*",
    "@angular/forms": "*"
  1. Module configuration: by default ngm reads angular-cli.json in projects root
    "name": "ng2-bootstrap",
    "root": "src",
    "outDir": "dist",
    "tsconfig": "tsconfig.json"
  1. Running: just add ngm script to your root package.json (see sample project structure above)
    "build": "ngm"
  1. Ready steady go:
npm run build
  1. Now you can go to dist folder and do npm publish (will be added as a command later)