Skip to content

Unified tooling for Node.js

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

xosnrdev/cargonode

Repository files navigation

cargonode logo

cargonode

Build Status cargonode Crate cargonode Docs License License

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?

  1. High Performance
    Written in Rust, cargonode offers fast execution and low overhead.
  2. Centralized Commands
    Replaces multiple shell scripts or separate binary invocations with a single CLI.
  3. Flexible Customization
    Allows swapping out default commands or adding custom prechecks.
  4. 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:

  1. Shell Installer (Linux)

    curl -fsSL https://raw.githubusercontent.com/xosnrdev/cargonode/master/install_cargonode.sh | bash

    Downloads the latest release from GitHub and installs locally, typically in ~/.local/bin.

  2. Homebrew (macOS)

    brew install xosnrdev/cargonode/cargonode

    Recommended if you prefer managing software through Homebrew on macOS.

  3. Nix (nixOS)

    nix-env -iA nixpkgs.cargonode

    See nixpkgs for additional details.

  4. 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

  1. Command-line arguments
  2. Project configuration in cargonode.toml
  3. 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.