3 releases
0.1.3 | Jan 9, 2025 |
---|---|
0.1.2 | Dec 2, 2024 |
0.1.1 | Dec 1, 2024 |
0.1.0 |
|
#132 in Build Utils
139 downloads per month
100KB
751 lines
Overview
cargonode is a Rust-based CLI that simplifies Node.js development by consolidating common tooling under a single executable. It serves as a wrapper around key utilities for building, testing, formatting, linting, and releasing your projects.
Why cargonode?
- High Performance
Written in Rust, cargonode offers fast execution and low overhead. - Centralized Commands
Replaces multiple shell scripts or separate binary invocations with a single CLI. - Flexible Customization
Allows swapping out default commands or adding custom prechecks. - Cross-Platform Compatibility
Runs on macOS (Intel and ARM), Linux (x64, ARM), and Windows (x64, ARM).
Requirements
- Node.js ≥ 20.11.0
Needed for the underlying tools (Biome, Tsup, Vitest, Release-It). - Rust ≥ 1.80
Required for installation from source or cargo. Binary releases do not require a Rust compiler on the end-user machine.
Supported Platforms
- macOS (x64, ARM)
- Linux (x64, ARM)
- Windows (x64, ARM)
Installation
Choose the option that fits your environment:
-
Homebrew (macOS)
brew install xosnrdev/cargonode/cargonode
Recommended if you prefer managing software through Homebrew on macOS.
-
Nix (nixOS)
nix-env -iA nixpkgs.cargonode
See nixpkgs for additional details.
-
Cargo (Rust)
cargo install cargonode
Installs the executable from source via the Rust package manager.
Usage
Below are common commands. Each command calls an underlying tool with sensible defaults:
# Create a new project
cargonode new my-app
# Convert an existing Node.js project
cargonode init
# Build using tsup by default
cargonode build
# Test using vitest
cargonode test
# Format code with biome
cargonode fmt
# Lint/check code with biome
cargonode check
# Release with release-it
cargonode release
Passing Tool Arguments
Any extra flags provided after the subcommand go directly to the underlying tool:
# Calls 'vitest run'
cargonode test run
# Calls 'biome check --fix'
cargonode check --fix
To see available flags, run:
cargonode --help
cargonode build --help
Configuration
By default, cargonode uses several best-practice settings, but it can be customized through a cargonode.toml
in your
project root. For instance:
[commands.format]
command = "eslint"
args = ["--fix"]
[commands.release]
prechecks = ["test", "build"]
In this example, eslint
replaces biome for the format
command, and prechecks
ensures tests and builds run before
any release process.
Configuration Precedence
- Command-line arguments
- Project configuration in
cargonode.toml
- Built-in defaults
See the Template Reference for additional examples.
Support
For issues, feature requests, or general feedback, visit the GitHub Issues page. Contributions are welcome, whether in the form of bug reports, pull requests, or suggestions.
License
This project is available under a dual license: MIT or Apache-2.0. Choose whichever license works best for your project or organization.
Dependencies
~11–22MB
~320K SLoC