Nswatch

Like gulp.watch but for npm scripts.
Alternatives To Nswatch
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Webpack Dev Server7,602435,21577,958a day ago203September 19, 202256mitJavaScript
Serves a webpack app. Updates the browser on changes. Documentation https://webpack.js.org/configuration/dev-server/.
Npm Run All4,66344,01728,492a year ago58November 24, 201884mitJavaScript
A CLI tool to run multiple npm-scripts in parallel or sequential.
Nps1,391930645a year ago36July 10, 202025mitJavaScript
NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
Ultra Runner1,12953 days ago45February 28, 202137apache-2.0TypeScript
🏃⛰ Ultra fast monorepo script runner and build tool
Awesome Npm Scripts672
6 months agocc0-1.0
Everything awesome related to npm scripts and using npm as a build tool.
Better Npm Run6413,4856377 months ago17July 31, 20183mitJavaScript
🏃‍♂️ Better NPM scripts runner
Tasksfile3522393275 months ago43January 25, 2019mitTypeScript
Minimalistic task runner for node.js
Vscode Npm Scripts208
2 months ago2mitTypeScript
VSCode extension for running npm-scripts and validating the package.json files.
Npm Run1791,5852544 years ago14April 12, 20186mitJavaScript
Run locally-installed node module executables.
Node Themekit1168234a year ago24June 23, 202124mitJavaScript
Theme asset interaction library and management tools written in Node.js
Alternatives To Nswatch
Select To Compare


Alternative Project Comparisons
Readme

nswatch

NPM version NPM downloads Build Status

Like gulp.watch but for npm scripts.

Install

$ npm install -D nswatch

Usage

Assuming you have an npm script build to compile something, then drop a watch.js in your project:

import { watch } from "nswatch";

watch("src/*.js", ["build"]);

When you run node watch, the npm run build will be invoked right away, and will also be invoked when file changes are detected.

Parallel and Sequence

Array will be treated as parallel, String will be treated as sequence:

// run in parallel
watch("src/a.js", ["task-a", "task-b"]);
// run in sequence
// use ! as seperator
watch("src/b.js", "task-a!task-b");

CLI

$ npm install -g nswatch

You can also use nswatch as a command-line program:

Configure watch in package.json

{
  "watch": {
    "./src/*.js": ["build"],
    "./src/*.css": "compile!minify"
  }
}

Then run:

$ nswatch

Or you can pass the config via CLI arguments, this way configurations in package.json will be ignored.

# in parallel
$ nswatch "src/*.js" --script foo --script bar

# in sequence
$ nswatch "src/*.js" --script "foo!bar"

Author

nswatch EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).

egoistian.com GitHub @egoist Twitter @rem_rin_rin

Popular Npm Scripts Projects
Popular Command Line Projects
Popular Build Tools Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Typescript
Cli
Parallel
Npm Scripts