Track Awesome Npm Scripts Updates Weekly
Everything awesome related to npm scripts and using npm as a build tool.
🏠 Home · 🔍 Search · 🔥 Feed · 📮 Subscribe · ❤️ Sponsor · 😺 RyanZim/awesome-npm-scripts · ⭐ 678 · 🏷️ Programming Languages
Sep 19 - Sep 25, 2022
Articles
- How to Use npm as a Build Tool - Sequel to »Why we should stop using Grunt & Gulp«.
- Running cross-platform tasks via npm package scripts - The most comprehensive guide to using npm Scripts by Dr. Axel Rauschmayer.
Feb 25 - Mar 03, 2019
Videos/Talks
- Advanced front-end automation with npm scripts - Talk at Nordic.js 2015 by Kate Hudson.
Cross-platform Utilities
- cpr (⭐76) -
cp -r
for Node.js.
Other Utilities / Utility Packs
- Bower files CLI (⭐3) - Get main bower files on the command line.
Cross-platform Shell Reference / Utility Packs
- Use
&&
to run commands in sequence. If a command fails, the script exits.
- Use
|
to pipe the stdout of one command into the stdin of the next. (do-something | something else
)
- Use
>
to write the stdout of a command to a file. (do-something > file
)
- Use
<
to send the contents of a file to a command's stdin. (command < file
)
- Use
cd <dir>
to change the current working directory to<dir>
. Note thatcd
alone prints the current working directory on windows, but changes the working directory to~
on *nix.
Apr 02 - Apr 08, 2018
Articles
- Helpers and tips for npm run scripts - Blog post by Michael Kühnel covering advanced topics.
Other Utilities / Utility Packs
- cli-error-notifier (⭐64) - Send native desktop notifications when npm scripts fail.
Miscellaneous / Utility Packs
- ntl (⭐872) - Interactive cli menu to list and run npm scripts.
May 15 - May 21, 2017
Cross-platform Utilities
- rimraf (⭐4.9k) - Delete files or directories; like
rm -rf
.
- mkdirp - Create a directory, creating parent directories if needed; like
mkdir -p
.
- cpy-cli (⭐279) - File/directory copying/renaming.
- copyfiles (⭐345) - Copy a list of files into a directory.
- sync-files (⭐42) -
rsync
-like directory syncing with watch mode.
- clear-cli (⭐46) - Clear the terminal.
- ntee (⭐23) - Utility that reads from standard input and writes to standard output and files; like Unix
tee
.
- catw - Print a file to stdout, with optional watch mode; sorta like Unix
cat
.
Cross-platform Utilities / Utility Packs
- shx (⭐1.4k) - Collection of common Unix utilities implemented in Node.js; example usage:
shx rm somefile
.
Apr 24 - Apr 30, 2017
Articles
- Why we should stop using Grunt & Gulp - Blog post by Keith Cirkel.
- Why I Left Gulp and Grunt for npm Scripts - Article by Cory House.
Dev Servers
- http-server (⭐12k) - Simple zero-configuration command-line http server.
Cross-platform Utilities
- cross-os (⭐34) - Run platform-specific npm scripts.
Miscellaneous / Utility Packs
- Forrest (⭐338) - npm scripts desktop client.
Apr 03 - Apr 09, 2017
Miscellaneous / Utility Packs
- edit-script (⭐9) - Edit npm scripts from the command line without worrying about JSON escaping.
Jan 30 - Feb 05, 2017
Videos/Talks
- How to create a build system with npm scripts - Video tutorial series on setting up a front-end build system.
Dec 26 - Jan 01, 2016
Other Utilities / Utility Packs
- headr (⭐3) - Add header / banner info to a file.
Oct 10 - Oct 16, 2016
Miscellaneous / Utility Packs
- npm-quick-run (⭐131) - Quickly run npm scripts by prefix without typing the full name.
Oct 03 - Oct 09, 2016
Task Runners
- redrun (⭐110) - Expand scripts from package.json to improve execution speed.
Dev Servers
- live-server (⭐4k) - Simple development http server with live reload capability.
Cross-platform Utilities
- del-cli (⭐265) - Safer file and folder deletion.
- cross-env (⭐5.9k) - Set environment variables for scripts, unix-style.
Other Utilities / Utility Packs
- gzip-size-cli (⭐180) - Get the gzipped size of a file or stdin.
- opn-cli (⭐370) - Open websites, files, executables, etc. with the user's preferred application.
Miscellaneous / Utility Packs
- run-npm (⭐180) - Run locally-installed node module executables. Useful for debugging npm scripts.
Sep 26 - Oct 02, 2016
Miscellaneous / Utility Packs
- screwy (⭐106) - The npm scripts GUI.
npm run
Reference / Utility Packs
- 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
.
- You can run
npm run <script> -s
to silence the default npm output (useful for calling a script within another script).
Sep 05 - Sep 11, 2016
Task Runners
- script-runner (⭐25) - Simple task runner with a terse syntax.
- npm-run-all (⭐5k) - Fully featured task runner.
File Watchers
- onchange (⭐775) -
onchange <glob> -- <command>
.
- watch (⭐1.2k) -
watch <command> <directory>
.
Cross-platform Utilities
- echo-cli (⭐6) - Cross-platform
echo
with JS escape sequence support.
Other Utilities / Utility Packs
- hashmark (⭐194) - Take contents of a file and output as new file with a hash in the name.
npm run
Reference / Utility Packs
- 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
- Running
npm test
is the same as runningnpm run test
. The same applies tonpm start
andnpm stop
.