
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
better-scripts
Advanced tools
The next level of npm scripts. An npm scripts runner. A better way to organize your npm scripts. Make redundant NPM scripts easier to read, maintain and use.
A better way to organize your npm scripts
See better-scripts.vercel.app →
Install with yarn
yarn add better-scripts -D
Or install with npm
npm install better-scripts --save-dev
Or install with pnpm
pnpm add better-scripts -D
Or use npx for one-time use
npx better-scripts
Simply run npx better-scripts
will read your existing scripts, let's give it a try at first
npx better-scripts
Now, let's move all scripts
into better-scripts
and add only one "scripts": "better-scripts"
in scripts
{
"scripts": {
"scripts": "better-scripts"
},
"better-scripts": {
"dev": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test"
}
}
Then run yarn scripts
will read your scripts from better-scripts
yarn scripts
Second value as description in array form
{
"better-scripts": {
"dev": ["react-scripts start", "Start a development server"]
}
}
You can add more properties in object form
{
"better-scripts": {
"dev": {
"alias": "🧑🏻💻 Dev",
"command": "react-scripts start",
"desc": "Start a development server"
}
}
}
You can write your "better-scriprts" out of package.json
Create a scripts.json
file in the root directory
{
"dev": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test"
}
Supported file formats
better-scripts
property in package.json (⭐️ Recommended)scripts.json
(⭐️⭐️ Recommended)better-scripts.json
.better-scriptsrc
.better-scriptsrc.json
.better-scriptsrc.yaml
.better-scriptsrc.yml
.better-scriptsrc.js
.better-scriptsrc.cjs
better-scriptsrc.config.js
better-scriptsrc.config.cjs
yarn scripts --config custom-config.json
yarn scripts --help
➤_ A better way to organize your npm scripts
Commands:
better-scripts Run your script [default]
better-scripts run <name> Run script non-interactive, usually in CI mode
better-scripts list [name] Show all scripts
Options:
-v, --version Show version number [boolean]
-c, --config Specified config filepath [string]
--track Show tracked error stack message
-h, --help Show help [boolean]
Examples:
npx better-scripts - Run your script interactive
npx better-scripts run dev - Run "dev" script non-interactive
npx better-scripts run build.deploy - Run "build" and "deploy" child script in chain order
npx better-scripts list - Show all scripts
Interactive with one simple command
yarn scripts
Non-interactive with specific command
yarn scripts run <name>
<name>
is your script name that defined in config
Chain operation
yarn scripts run <name.name...>
Skip chaining paths
yarn scripts run <name.name...> --skip
-s, --skip
Show all your scripts
yarn scripts list
Compact mode
yarn scripts list --compact
Show specific script name's scripts
yarn scripts list <name>
yarn scripts list <name.name...>
The API is not stable yet
iamyoki | Garker | annoyc |
---|---|---|
FAQs
The next level of npm scripts. An npm scripts runner. A better way to organize your npm scripts. Make redundant NPM scripts easier to read, maintain and use.
The npm package better-scripts receives a total of 3,829 weekly downloads. As such, better-scripts popularity was classified as popular.
We found that better-scripts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.