Ranked awesome lists, all in one place
This list is a copy of RyanZim/awesome-npm-scripts with ranks
Awesome npm scripts
Everything awesome for using npm as a build tool.
You might also like awesome-npm ★2944.
Notice: I’m currently too busy to actively expand this list; therefore, I’ve decided to make this an OPEN Open Source Project. Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit.
Contents
- Articles
- Videos/Talks
- Task Runners
- File Watchers
- Dev Servers
- Cross-platform Utilities
- Other Utilities
- Miscellaneous
- Cross-platform Shell Reference
npm run
Reference- Contributing
- License
Articles
- Why we should stop using Grunt & Gulp - Blog post by Keith Cirkel.
- How to Use npm as a Build Tool - Sequel to Why we should stop using Grunt & Gulp.
- Why I Left Gulp and Grunt for npm Scripts - Article by Cory House.
- Helpers and tips for npm run scripts - Blog post by Michael Kühnel covering advanced topics.
Videos/Talks
- Advanced front-end automation with npm scripts - Talk at Nordic.js 2015 by Kate Hudson
- How to create a build system with npm scripts - Video tutorial series on setting up a front-end build system.
Task Runners
Tools for running multiple commands or npm scripts in parallel or sequentially.
- script-runner ★16 ⏳1Y - Simple task runner with a terse syntax.
- npm-run-all ★1935 - Fully featured task runner.
- redrun ★61 - Expand scripts from package.json to improve execution speed.
File Watchers
Tools to watch your source files and run a build command whenever any of the files change.
- onchange ★393 -
onchange <glob> -- <command>
. - watch ★1055 -
watch <command> <directory>
.
Dev Servers
- http-server ★7018 - Simple zero-configuration command-line http server.
- live-server ★2205 - Simple development http server with live reload capability.
Cross-platform Utilities
Utilities to perform common command-line tasks without worrying about cross-platform compatibility.
- rimraf ★2528 - Delete files or directories; like
rm -rf
. - del-cli ★94 ⏳1Y - Safer file and folder deletion.
- mkdirp ★1810 - Create a directory, creating parent directories if needed; like
mkdir -p
. - cpr ★55 -
cp -r
for Nodejs - cpy-cli ★78 - File/directory copying/renaming.
- copyfiles ★92 - Copy a list of files into a directory.
- sync-files ★29 -
rsync
-like directory syncing with watch mode. - echo-cli ★3 ⏳2Y - Cross-platform
echo
with JS escape sequence support. - clear-cli ★34 ⏳2Y - Clear the terminal.
- cross-env ★2689 - Set environment variables for scripts, unix-style.
- cross-os ★7 - Run platform-specific npm scripts.
- ntee ★17 ⏳1Y - Utility that reads from standard input and writes to standard output and files; like Unix
tee
. - catw ★112 ⏳3Y - Print a file to stdout, with optional watch mode; sorta like Unix
cat
.
Utility Packs
- shx ★512 - Collection of common Unix utilities implemented in Node.js; example usage:
shx rm somefile
.
Other Utilities
- hashmark ★186 - Take contents of a file and output as new file with a hash in the name.
- gzip-size-cli ★101 - Get the gzipped size of a file or stdin.
- opn-cli ★160 ⏳2Y - Open websites, files, executables, etc. with the user’s preferred application.
- headr ★0 ⏳1Y - Add header / banner info to a file.
- Bower files CLI ★3 ⏳1Y - Get main bower files on the command line
- cli-error-notifier ★38 - Send native desktop notifications when npm scripts fail.
Miscellaneous
- screwy ★96 ⏳1Y - The npm scripts GUI.
- Forrest ★272 ⏳1Y - npm scripts desktop client.
- run-npm ★167 - Run locally-installed node module executables. Useful for debugging npm scripts.
- npm-quick-run ★75 - Quickly run npm scripts by prefix without typing the full name.
- edit-script ★5 - Edit npm scripts from the command line without worrying about JSON escaping.
- ntl ★506 - Interactive cli menu to list and run npm scripts.
Cross-platform Shell Reference
A quick reference of the shell operators & commands that work the same on Unix and Windows.
&&
runs commands in sequence. If a command fails, the script exits.|
pipes the stdout of one command into the stdin of the next. (do-something | something else
)>
writes the stdout of a command to a file. (do-something > file
)<
sends the contents of a file to a command’s stdin. (command < file
)cd <dir>
changes the current working directory to<dir>
. Note thatcd
alone prints the current working directory on windows, but changes the working directory to~
on *nix.
npm run
Reference
You can use npm run-script
or npm run
; they both do the same thing, but npm run
is shorter.
- Run just
npm run
to print a list of scripts. - Running
npm run script
(wherescript
is the name of your script) will runprescript
,script
, andpostscript
; in that order.- You can’t nest
pre
andpost
hooks (i.e.preprescript
won’t work).
- You can’t nest
- You can pass arguments to your scripts by passing
--
tonpm run
, followed by the arguments. Example: Given the script"mocha": "mocha"
, you can runnpm run mocha -- --reporter xunit
. This effectively runsmocha --reporter xunit
. - Running
npm test
is the same as runningnpm run test
. The same applies tonpm start
andnpm stop
. - You can run
npm run <script> -s
to silence the default npm output (useful for calling a script within another script).
Contributing
See CONTRIBUTING.md.
License
This list is a copy of RyanZim/awesome-npm-scripts with ranks