You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

better-npm-run

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-npm-run

Better NPM scripts runner

0.0.1
Source
npmnpm
Version published
Weekly downloads
49K
-12.03%
Maintainers
1
Weekly downloads
 
Created
Source

Intro

Better NPM scripts runner

  • Avoid hard-coded commands in package.json
  • Cross-platform compatibility, originally needed by:
    • https://github.com/formly-js/angular-formly/issues/305

Usage in package.json

From this:

{
  "scripts": {
    "build:dist": "NODE_ENV=development webpack --config $npm_package_webpack --progress --colors",
    "test": "NODE_ENV=production karma start"
  }
}

To this:

{
	"devDependencies": {
		"better-npm-run": "~0.0.1"
	},
  "scripts": {
    "build:dist": "better-npm-run build:dist",
    "test": "better-npm-run test"
  },
  "betterScripts": {
    "build:dist": {
        "command": "webpack --config $npm_package_webpack --progress --colors",
        "env": {
            "NODE_ENV": "development"
        }
    },
    "build:prod": {
        "command": "webpack --config $npm_package_webpack --progress --colors",
        "env": {
            "NODE_ENV": "production"
        }
    },
    "build": [
        {
            "run": "build:dist"
        },
        {
            "run": "build:prod"
        }
    ],
    "test": {
        "command": "karma start",
        "env": {
            "NODE_ENV": "test"
        }
    }
  },

}

Inspired by

FAQs

Package last updated on 16 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts