nofi
v1.2.0
Published
If you're online, it installs/caches npm packages with --force (so you get fresh packages). If you're offline, it installs cached packages with --cache-min.
Downloads
4
Readme
nofi
npm Online-First Installer
Do you switch between online/offline environments somewhat regularly?
Installation/Usage
npm i -g nofi
- Replace all your
npm install
commands withnofi
Examples
✖︎ npm install
✔︎ nofi
✖︎ npm install --save foo
✔︎ nofi --save foo
✖︎ npm install --save-dev foo
✔︎ nofi --save-dev foo
✖︎ npm install --save-optional foo
✔︎ nofi --save-optional foo
Flag aliases and installing multiple packages work as well...
nofi -S foo
nofi -D foo bar
nofi -O foo bar baz
How does it work?
- Test internet connection using is-online.
- If online, use
npm install --force
to install/cache the latest package. - If offline, use
npm install --cache-min Infinity
to install from your cache (usually located in~/.npm
).