A simple build tool for Node.js projects.
brew install xosnrdev/cargonode/cargonode
curl -LsSf https://github.com/xosnrdev/cargonode/releases/download/1.0.0/cargonode-installer.sh | sh
iwr https://github.com/xosnrdev/cargonode/releases/download/1.0.0/cargonode-installer.ps1 | iex
cargo install cargonode
Checkout releases page for more information.
Usage: cargonode <COMMAND>
Commands:
new Create a new Node.js project at PATH
init Create a new Node.js project in an existing directory
run Run a specific tool
check Check files for errors
build Build the project
test Run tests
help Print this message
Options:
-h, --help Print help
-V, --version Print version
Cargonode uses a simple protocol in your package.json
to define build tools:
{
"cargonode": {
"tools": {
"build": {
"command": "tsc", // Command to execute
"args": ["--outDir", "dist"], // Command arguments (optional)
"env": { // Environment variables (optional)
"NODE_ENV": "production"
},
"working_dir": "packages/core", // Working directory (optional)
"inputs": ["src/**/*.ts"], // Input file patterns (required)
"outputs": ["dist/**/*.js"] // Output file patterns (optional)
}
}
}
}
command
: The executable to run (required)args
: List of command-line arguments (optional)env
: Environment variables to set (optional)working_dir
: Directory to run the command in (optional)inputs
: Glob patterns for input files (required)outputs
: Glob patterns for output files (optional)- Only specify for commands that generate files
- Directories will be created automatically
{
"cargonode": {
"tools": {
"dev": {
"command": "ts-node-dev",
"args": ["src/index.ts"],
"inputs": ["src/**/*.ts"]
},
"test": {
"command": "jest",
"args": ["--coverage"],
"inputs": ["src/**/*.ts", "test/**/*.ts"],
"outputs": ["coverage/**/*"]
}
}
}
}
cargonode run dev # Calls the dev protocol
cargonode test # Calls the test protocol
Cargonode provides clear error messages and handles common scenarios:
- Missing output directories are created automatically
- Command failures include helpful suggestions
- Use verbose mode (
-v
) to see detailed command output and progress
MIT or Apache-2.0