131 lines
14 KiB
Plaintext
131 lines
14 KiB
Plaintext
|
||
[38;5;12m [39m[38;2;255;187;0m[1m[4mAwesome npm Scripts [0m[38;5;14m[1m[4m![0m[38;2;255;187;0m[1m[4mAwesome[0m[38;5;14m[1m[4m (https://awesome.re/badge.svg)[0m[38;2;255;187;0m[1m[4m (https://awesome.re)[0m
|
||
|
||
[38;5;12m (https://www.npmjs.com)[39m
|
||
|
||
[38;5;11m[1m▐[0m[38;5;12m [39m[38;5;12mEverything awesome for using npm as a build tool.[39m
|
||
|
||
[38;5;12mYou might also like [39m[38;5;14m[1mawesome-npm[0m[38;5;12m (https://github.com/sindresorhus/awesome-npm).[39m
|
||
|
||
[38;5;14m[1mNotice:[0m[38;5;14m[1m [0m[38;5;14m[1mI'm[0m[38;5;14m[1m [0m[38;5;14m[1mcurrently[0m[38;5;14m[1m [0m[38;5;14m[1mtoo[0m[38;5;14m[1m [0m[38;5;14m[1mbusy[0m[38;5;14m[1m [0m[38;5;14m[1mto[0m[38;5;14m[1m [0m[38;5;14m[1mactively[0m[38;5;14m[1m [0m[38;5;14m[1mexpand[0m[38;5;14m[1m [0m[38;5;14m[1mthis[0m[38;5;14m[1m [0m[38;5;14m[1mlist;[0m[38;5;14m[1m [0m[38;5;14m[1mtherefore,[0m[38;5;14m[1m [0m[38;5;14m[1mI've[0m[38;5;14m[1m [0m[38;5;14m[1mdecided[0m[38;5;14m[1m [0m[38;5;14m[1mto[0m[38;5;14m[1m [0m[38;5;14m[1mmake[0m[38;5;14m[1m [0m[38;5;14m[1mthis[0m[38;5;14m[1m [0m[38;5;14m[1man[0m[38;5;14m[1m [0m[38;5;12mOPEN[39m[38;5;12m [39m[38;5;12mOpen[39m[38;5;12m [39m[38;5;12mSource[39m[38;5;12m [39m[38;5;12mProject[39m[38;5;14m[1m [0m[38;5;14m[1m(http://openopensource.github.io/).[0m[38;5;14m[1m [0m[38;5;14m[1mIndividuals[0m[38;5;14m[1m [0m[38;5;14m[1mmaking[0m[38;5;14m[1m [0m[38;5;14m[1msignificant[0m[38;5;14m[1m [0m[38;5;14m[1mand[0m[38;5;14m[1m [0m[38;5;14m[1mvaluable[0m[38;5;14m[1m [0m[38;5;14m[1mcontributions[0m[38;5;14m[1m [0m[38;5;14m[1mare[0m[38;5;14m[1m [0m[38;5;14m[1mgiven[0m[38;5;14m[1m [0m[38;5;14m[1mcommit-access[0m[38;5;14m[1m [0m[38;5;14m[1mto[0m
|
||
[38;5;14m[1mthe[0m[38;5;14m[1m [0m[38;5;14m[1mproject[0m[38;5;14m[1m [0m[38;5;14m[1mto[0m[38;5;14m[1m [0m[38;5;14m[1mcontribute[0m[38;5;14m[1m [0m[38;5;14m[1mas[0m[38;5;14m[1m [0m[38;5;14m[1mthey[0m[38;5;14m[1m [0m[38;5;14m[1msee[0m[38;5;14m[1m [0m[38;5;14m[1mfit.[0m
|
||
|
||
[38;2;255;187;0m[4mContents[0m
|
||
|
||
|
||
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mArticles[0m[38;5;12m (#articles)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mVideos/Talks[0m[38;5;12m (#videostalks)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mTask Runners[0m[38;5;12m (#task-runners)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mFile Watchers[0m[38;5;12m (#file-watchers)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mDev Servers[0m[38;5;12m (#dev-servers)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mCross-platform Utilities[0m[38;5;12m (#cross-platform-utilities)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mUtility Packs[0m[38;5;12m (#utility-packs)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mOther Utilities[0m[38;5;12m (#other-utilities)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mMiscellaneous[0m[38;5;12m (#miscellaneous)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mCross-platform Shell Reference[0m[38;5;12m (#cross-platform-shell-reference)[39m
|
||
[38;5;12m- [39m[48;5;235m[38;5;249m[1mnpm run[0m[38;5;14m[1m Reference[0m[38;5;12m (#npm-run-reference)[39m
|
||
|
||
|
||
|
||
[38;2;255;187;0m[4mArticles[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mWhy we should stop using Grunt & Gulp[0m[38;5;12m (https://www.keithcirkel.co.uk/why-we-should-stop-using-grunt/) - Blog post by Keith Cirkel.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mHow to Use npm as a Build Tool[0m[38;5;12m (https://www.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/) - Sequel to »Why we should stop using Grunt & Gulp«.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mWhy I Left Gulp and Grunt for npm Scripts[0m[38;5;12m (https://medium.freecodecamp.com/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8) - Article by Cory House.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mHelpers and tips for npm run scripts[0m[38;5;12m (http://michael-kuehnel.de/tooling/2018/03/22/helpers-and-tips-for-npm-run-scripts.html) - Blog post by Michael Kühnel covering advanced topics.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mRunning cross-platform tasks via npm package scripts[0m[38;5;12m (https://exploringjs.com/nodejs-shell-scripting/ch_package-scripts.html) - The most comprehensive guide to using npm Scripts by Dr. Axel Rauschmayer.[39m
|
||
|
||
[38;2;255;187;0m[4mVideos/Talks[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mAdvanced front-end automation with npm scripts[0m[38;5;12m (https://www.youtube.com/watch?v=0RYETb9YVrk) - Talk at Nordic.js 2015 by Kate Hudson.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mHow to create a build system with npm scripts[0m[38;5;12m (http://www.penta-code.com/how-to-create-a-build-system-with-npm-scripts/) - Video tutorial series on setting up a front-end build system.[39m
|
||
|
||
[38;2;255;187;0m[4mTask Runners[0m
|
||
|
||
[38;5;12mTools for running multiple commands or npm scripts in parallel or sequentially.[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mscript-runner[0m[38;5;12m (https://github.com/paulpflug/script-runner) - Simple task runner with a terse syntax.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mnpm-run-all[0m[38;5;12m (https://github.com/mysticatea/npm-run-all) - Fully featured task runner.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mredrun[0m[38;5;12m (https://github.com/coderaiser/redrun) - Expand scripts from package.json to improve execution speed.[39m
|
||
|
||
[38;2;255;187;0m[4mFile Watchers[0m
|
||
|
||
[38;5;12mTools to watch your source files and run a build command whenever any of the files change.[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1monchange[0m[38;5;12m (https://github.com/Qard/onchange) - [39m[48;5;235m[38;5;249monchange [49m[39m[38;5;12m.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mwatch[0m[38;5;12m (https://github.com/mikeal/watch) - [39m[48;5;235m[38;5;249mwatch [49m[39m[38;5;12m.[39m
|
||
|
||
[38;2;255;187;0m[4mDev Servers[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mhttp-server[0m[38;5;12m (https://github.com/indexzero/http-server) - Simple zero-configuration command-line http server.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mlive-server[0m[38;5;12m (https://github.com/tapio/live-server) - Simple development http server with live reload capability.[39m
|
||
|
||
[38;2;255;187;0m[4mCross-platform Utilities[0m
|
||
|
||
[38;5;12mUtilities to perform common command-line tasks without worrying about cross-platform compatibility.[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mrimraf[0m[38;5;12m (https://github.com/isaacs/rimraf) - Delete files or directories; like [39m[48;5;235m[38;5;249mrm -rf[49m[39m[38;5;12m.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mdel-cli[0m[38;5;12m (https://github.com/sindresorhus/del-cli) - Safer file and folder deletion.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mmkdirp[0m[38;5;12m (https://github.com/substack/node-mkdirp) - Create a directory, creating parent directories if needed; like [39m[48;5;235m[38;5;249mmkdir -p[49m[39m[38;5;12m.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mcpr[0m[38;5;12m (https://github.com/davglass/cpr) - [39m[48;5;235m[38;5;249mcp -r[49m[39m[38;5;12m for Node.js.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mcpy-cli[0m[38;5;12m (https://github.com/sindresorhus/cpy-cli) - File/directory copying/renaming.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mcopyfiles[0m[38;5;12m (https://github.com/calvinmetcalf/copyfiles) - Copy a list of files into a directory.[39m
|
||
[38;5;12m- [39m[38;5;14m[1msync-files[0m[38;5;12m (https://github.com/byteclubfr/node-sync-files) - [39m[48;5;235m[38;5;249mrsync[49m[39m[38;5;12m-like directory syncing with watch mode.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mecho-cli[0m[38;5;12m (https://github.com/iamakulov/echo-cli) - Cross-platform [39m[48;5;235m[38;5;249mecho[49m[39m[38;5;12m with JS escape sequence support.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mclear-cli[0m[38;5;12m (https://github.com/sindresorhus/clear-cli) - Clear the terminal.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mcross-env[0m[38;5;12m (https://github.com/kentcdodds/cross-env) - Set environment variables for scripts, unix-style.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mcross-os[0m[38;5;12m (https://github.com/milewski/cross-os) - Run platform-specific npm scripts.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mntee[0m[38;5;12m (https://github.com/stefanmaric/ntee) - Utility that reads from standard input and writes to standard output and files; like Unix [39m[48;5;235m[38;5;249mtee[49m[39m[38;5;12m.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mcatw[0m[38;5;12m (https://github.com/substack/catw) - Print a file to stdout, with optional watch mode; sorta like Unix [39m[48;5;235m[38;5;249mcat[49m[39m[38;5;12m.[39m
|
||
|
||
[38;2;255;187;0m[4mUtility Packs[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mshx[0m[38;5;12m (https://github.com/shelljs/shx) - Collection of common Unix utilities implemented in Node.js; example usage: [39m[48;5;235m[38;5;249mshx rm somefile[49m[39m[38;5;12m.[39m
|
||
|
||
[38;2;255;187;0m[4mOther Utilities[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mhashmark[0m[38;5;12m (https://github.com/keithamus/hashmark) - Take contents of a file and output as new file with a hash in the name.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mgzip-size-cli[0m[38;5;12m (https://github.com/sindresorhus/gzip-size-cli) - Get the gzipped size of a file or stdin.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mopn-cli[0m[38;5;12m (https://github.com/sindresorhus/opn-cli) - Open websites, files, executables, etc. with the user's preferred application.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mheadr[0m[38;5;12m (https://github.com/heldr/headr) - Add header / banner info to a file.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mBower files CLI[0m[38;5;12m (https://github.com/thompsonemerson/bower-files-cli) - Get main bower files on the command line.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mcli-error-notifier[0m[38;5;12m (https://github.com/micromata/cli-error-notifier) - Send native desktop notifications when npm scripts fail.[39m
|
||
|
||
[38;2;255;187;0m[4mMiscellaneous[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mscrewy[0m[38;5;12m (https://github.com/samueleaton/screwy) - The npm scripts GUI.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mForrest[0m[38;5;12m (https://github.com/stefanjudis/forrest) - npm scripts desktop client.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mrun-npm[0m[38;5;12m (https://github.com/timoxley/npm-run) - Run locally-installed node module executables. Useful for debugging npm scripts.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mnpm-quick-run[0m[38;5;12m (https://github.com/bahmutov/npm-quick-run) - Quickly run npm scripts by prefix without typing the full name.[39m
|
||
[38;5;12m- [39m[38;5;14m[1medit-script[0m[38;5;12m (https://github.com/RyanZim/edit-script) - Edit npm scripts from the command line without worrying about JSON escaping.[39m
|
||
[38;5;12m- [39m[38;5;14m[1mntl[0m[38;5;12m (https://github.com/ruyadorno/ntl) - Interactive cli menu to list and run npm scripts.[39m
|
||
|
||
[38;2;255;187;0m[4mCross-platform Shell Reference[0m
|
||
|
||
[38;5;12mA quick reference of the shell operators & commands that work the same on Unix and Windows.[39m
|
||
|
||
[38;5;12m- Use [39m[48;5;235m[38;5;249m&&[49m[39m[38;5;12m to run commands in sequence. If a command fails, the script exits.[39m
|
||
[38;5;12m- Use [39m[48;5;235m[38;5;249m|[49m[39m[38;5;12m to pipe the stdout of one command into the stdin of the next. ([39m[48;5;235m[38;5;249mdo-something | something else[49m[39m[38;5;12m)[39m
|
||
[38;5;12m- Use [39m[48;5;235m[38;5;249m>[49m[39m[38;5;12m to write the stdout of a command to a file. ([39m[48;5;235m[38;5;249mdo-something > file[49m[39m[38;5;12m)[39m
|
||
[38;5;12m- Use [39m[48;5;235m[38;5;249m<[49m[39m[38;5;12m to send the contents of a file to a command's stdin. ([39m[48;5;235m[38;5;249mcommand < file[49m[39m[38;5;12m)[39m
|
||
[38;5;12m- Use [39m[48;5;235m[38;5;249mcd [49m[39m[38;5;12m. Note that [39m[48;5;235m[38;5;249mcd[49m[39m[38;5;12m alone prints the current working directory on windows, but changes the working directory to [39m[48;5;235m[38;5;249m~[49m[39m[38;5;12m on [39m[38;5;12m*nix.[39m
|
||
|
||
[48;5;235m[38;5;249m[4mnpm run[0m[38;2;255;187;0m[4m Reference[0m
|
||
|
||
[38;5;12mYou can use [39m[48;5;235m[38;5;249mnpm run-script[49m[39m[38;5;12m or [39m[48;5;235m[38;5;249mnpm run[49m[39m[38;5;12m; they both do the same thing, but [39m[48;5;235m[38;5;249mnpm run[49m[39m[38;5;12m is shorter.[39m
|
||
|
||
[38;5;12m- Run just [39m[48;5;235m[38;5;249mnpm run[49m[39m[38;5;12m to print a list of scripts.[39m
|
||
[38;5;12m- Running [39m[48;5;235m[38;5;249mnpm run script[49m[39m[38;5;12m (where [39m[48;5;235m[38;5;249mscript[49m[39m[38;5;12m is the name of your script) will run [39m[48;5;235m[38;5;249mprescript[49m[39m[38;5;12m, [39m[48;5;235m[38;5;249mscript[49m[39m[38;5;12m, and [39m[48;5;235m[38;5;249mpostscript[49m[39m[38;5;12m; in that order.[39m
|
||
[38;5;12m - You can't nest [39m[48;5;235m[38;5;249mpre[49m[39m[38;5;12m and [39m[48;5;235m[38;5;249mpost[49m[39m[38;5;12m hooks (i.e. [39m[48;5;235m[38;5;249mpreprescript[49m[39m[38;5;12m won't work).[39m
|
||
[38;5;12m- You can pass arguments to your scripts by passing [39m[48;5;235m[38;5;249m--[49m[39m[38;5;12m to [39m[48;5;235m[38;5;249mnpm run[49m[39m[38;5;12m, followed by the arguments. Example: Given the script [39m[48;5;235m[38;5;249m"mocha": "mocha"[49m[39m[38;5;12m, you can run [39m[48;5;235m[38;5;249mnpm run mocha -- --reporter xunit[49m[39m[38;5;12m. This effectively runs [39m[48;5;235m[38;5;249mmocha --reporter xunit[49m[39m[38;5;12m.[39m
|
||
[38;5;12m- Running [39m[48;5;235m[38;5;249mnpm test[49m[39m[38;5;12m is the same as running [39m[48;5;235m[38;5;249mnpm run test[49m[39m[38;5;12m. The same applies to [39m[48;5;235m[38;5;249mnpm start[49m[39m[38;5;12m and [39m[48;5;235m[38;5;249mnpm stop[49m[39m[38;5;12m.[39m
|
||
[38;5;12m- You can run [39m[48;5;235m[38;5;249mnpm run -s[49m[39m[38;5;12m to silence the default npm output (useful for calling a script within another script).[39m
|
||
|
||
[38;2;255;187;0m[4mContributing[0m
|
||
|
||
[38;5;12mSee [39m[38;5;14m[1mCONTRIBUTING.md[0m[38;5;12m (https://github.com/RyanZim/awesome-npm-scripts/blob/master/CONTRIBUTING.md).[39m
|
||
|
||
[38;5;12mnpmscripts Github: https://github.com/RyanZim/awesome-npm-scripts[39m
|