
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
Usage:
runna <chain> [options]
Options:
-p <projects> Run with projects; a comma separated list.
-w [<path-to-watch>] Default is current.
-v Verbose mode (debug).
-o Use polling when watching (useful when using Docker).
{
"scripts": {
"clean": "rimraf ./dist",
"create-dist-dir": "mkdirp ./dist",
"build:js": "browserify ./src/index.js -o ./dist/index.js -t [ babelify --presets [ babel-preset-env ] ]",
"copy:html": "copyfiles --flat ./src/index.html ./dist",
"serve": "runna-webserver -w ./dist",
"serve:stop": "runna-webserver -x",
"serve:reload": "runna-webserver -r"
}
}
{
"scripts": {
"build": "runna [ clean - create-dist-dir - build:js copy:html ]"
}
}
The above build chain translates to:
clean | npm run clean
- | wait for all previous scripts to complete
create-dist-dir | npm run create-dist-dir
- | wait for all previous scripts to complete
build:js | npm run build:js
copy:html | npm run copy:html
npm run build
And that's it! The build chain executes all scripts as background processes. Note that the - symbol allows to wait for all the previous scripts to complete and behaves consistently on all OSes.
The development mode allows triggering chain upon a file change. To enable watch mode, simply add -w parameter. Let's define develop chain like so:
{
"scripts": {
"develop": "runna [ +serve clean - create-dist-dir - build:js copy:html - serve:reload ] -w",
}
}
The + symbol before a script name indicates, that the script should be run in the backgroud. Waiting for all previous tasks to complete with - igonres all background scripts automatically.
Now, let's define our observe rules like so:
{
"observe": {
"build:js - serve:reload": [
"src/**/*.js"
],
"copy:html - serve:reload": [
"src/**/*.html"
]
}
}
Notes:
-w <path-to-watch> parameter.-w flag will be run at least once, before watching begins.recursive flag of fs.watch(), which greatly improves performance on Windows and OS X compared to packages based on Chokidar (e.g. onchange or watchify), especially for large projects.It is possible to pass a file path to a script, that triggeted a chain execution when in watch mode. To do so, use $FILE variable like so:
{
"scripts": {
"build:html": "node scripts/build-html $FILE",
}
}
Notes:
$FILE variable will be replaced with the full path of the file that triggered the chain.$FILE will default to blank, so make sure your script handles it correctly (e.g. builds everything if no file is provided).It is possible to run the same script for multiple sub-projects using the $PROJ variable. Let's define a project-based script like so:
{
"scripts": {
"build:js": "browserify ./src/$PROJ/index.js -o ./dist/$PROJ/index.js -t [ babelify --presets [ babel-preset-env ] ]"
}
}
The presence of $PROJ placeholder enables project-based behaviour automatically. Let's update our develop chain to support projects. To do so, simply add -p parameter:
{
"scripts": {
"develop": "runna [ +serve clean - create-dist-dir - build:js copy:html - serve:reload ] -w -p red,blue"
}
}
When running the above chain with npm run develop, the build:js script will be run twice, once for each project. Scripts that do not use $PROJ placeholder will only run once as per usual. Think of it as of two separate scripts: build:js::red and build:js::blue.
Let's update our observe rule accordingly:
{
"observe": {
"build:js - serve:reload": [
"src/$PROJ/*.js",
"src/foo/**/*.js"
]
}
}
Notes:
src/blue/*.js, the build:js script will be run only for the the blue project. The $PROJ placeholder will be replaced with the actual folder name.src/foo/**/*.js, the build:js script will be run for all projects provided (in this case red and blue).-p option, all project-based scripts are ignored.FAQs
Runna - process based task runner for Node
The npm package runna receives a total of 21 weekly downloads. As such, runna popularity was classified as not popular.
We found that runna 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
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.