Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oslego/test-npm-run
Simple example how to use `npm run`
https://github.com/oslego/test-npm-run
Last synced: about 1 month ago
JSON representation
Simple example how to use `npm run`
- Host: GitHub
- URL: https://github.com/oslego/test-npm-run
- Owner: oslego
- Created: 2014-04-30T17:06:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-26T12:32:06.000Z (over 10 years ago)
- Last Synced: 2024-10-14T12:48:54.973Z (3 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Example of using `npm run`
Build automation using the `npm run` command, which runs tasks defined in the _scripts_ field in `package.json`. [Learn more](http://substack.net/task_automation_with_npm_run)
Advantages:
- adequate for simple projects
- minimal setup, dependencies come with `npm install`
- use any shell script, not just NodeJS packages or plugins### Setup
npm installPulls down dependencies defined in the _devDependencies_ field in `package.json`.
### Run tests
npm testRuns test.js with [TAP](https://www.npmjs.org/package/tap). Shortcut for `tap test.js`
### Build CSS
npm run build-cssCompiles `css/*.less` into CSS files, then concatenates `css/*.css` into `dist/styles.css`.
This example project uses [Less](http://lesscss.org/) for brevity (Less comes with `npm install`). Other pre-processors may be used.
### Development mode / watch
npm run devWatches for changes to `css/*.less` files then runs `npm run build-css`