1.0.4 • Published 6 years ago
npj v1.0.4
NPJ
npj (npm jumper) acts as a global bridge between all your npm projects.
Installation
npm i -g https://github.com/austinbillings/npj.gitOverview
npj makes use of a per-user local "registry" to keep track of which NPM packages are in development are in development where on your machine. This also allows it to easily run scripts from any registered package, triggerable from any directory on your system.
The file used by npj to store your registry lives at ~/.npj-registry, and its contents are a plain JSON object which maps projectName keys to packageDirPath values.
Usage
See help
npj --helpRegister a package
cd my-project # anything with a package.json will do
npj add[NPJ] ✓ OK: my-project -> /Users/admin/code/my-project @0.0.1Show registered packages
npj ls[NPJ] «package» my-project @0.0.1
[NPJ] >>>> -->--> /Users/admin/code/my-projectAdd another package
cd ../some-other-project
npj add[NPJ] ✓ OK: some-other-project -> /Users/admin/code/some-other-project @1.0.3Listing packages afterward (npj ls):
[NPJ] «package» my-project @0.0.1
[NPJ] >>>> -->--> /Users/admin/code/my-project
[NPJ] «package» some-other-project @1.0.3
[NPJ] >>>> -->--> /Users/admin/code/some-other-projectRemove from registry
cd my-project
npj remove[NPJ] ✓ OK: Removed "some-other-project" from registryList scripts offered by a registered package
npj scripts my-package[NPJ] «package» my-package @0.0.1
[NPJ] >>>> -->--> /Users/admin/code/my-package
[NPJ] «script» test
[NPJ] >>>> node tests/all.js
[NPJ] «script» build
[NPJ] >>>> node build.jsRun a registered package's script (or multiple!)
When multiple <packageName>:<scriptName> sets are provided, they are run in sequence (not parallel!)
npj my-project:build my-project:test[NPJ] «script» my-project: Running script «build»
> my-project@0.0.1 build /Users/admin/code/my-project
> node build.js
...
[NPJ] «script» script process exited with code 0
[NPJ] «script» my-project: Running script «test»
> my-project@0.0.1 test /Users/admin/code/my-project
> node tests/all.js
...
[NPJ] «script» script process exited with code 01.0.4
6 years ago
1.0.0-pre.1
8 years ago