interoper

Crates.iointeroper
lib.rsinteroper
version0.1.3
created_at2025-09-30 11:37:45.03049+00
updated_at2025-09-30 13:22:48.534734+00
descriptionBuild time tool for using Node.js packages from Rust project
homepagehttps://github.com/kappa8719/interoper
repositoryhttps://github.com/kappa8719/interoper
max_upload_size
id1861004
size21,549
최건 (kappa8719)

documentation

README

Interoper

A build-time tool for seamlessly integrating Node.js packages into your Rust projects. Interoper automatically resolves and manages JavaScript dependencies using your preferred package manager during the build process.

Features

  • Zero Runtime Overhead: All package resolution happens at build time
  • Package Manager Agnostic: Supports npm, pnpm, yarn, and bun
  • Simple Configuration: Configure dependencies with a single TOML file
  • Automatic Detection: Auto-detects your preferred package manager when not specified

Quick Start

  1. Add Interoper to your build dependencies:

    [build-dependencies]
    interoper = "0.1"
    
  2. Create an Interoper.toml file in your project root:

    package-manager = "bun"
    
    [dependencies]
    daisyui = "latest"
    lodash = "^4.17.21"
    
  3. Add a build script (build.rs):

    fn main() {
        interoper::build().expect("Failed to build interoper dependencies");
    }
    
  4. Build your project - Interoper will automatically resolve and install the specified Node.js packages.

Configuration

All configuration is done through the Interoper.toml file placed in your project root alongside Cargo.toml.

# Interoper.toml
package-manager = "pnpm"

[dependencies]
# UI Framework
daisyui = "latest"
tailwindcss = "^3.3.0"

# Utilities  
lodash = "^4.17.21"
date-fns = "^2.30.0"

# Development tools
typescript = "^5.1.0"

package-manager

Optional | Default: "auto"

Specifies which package manager to use. When set to "auto", Interoper will automatically detect and use the best available package manager on your system.

Supported values:

  • "auto" - Automatic detection
  • "npm", "pnpm", "yarn", "bun" - Specific package managers
  • "/path/to/executable" - Custom executable path

dependencies

Required

Map of Node.js package dependencies in name = "version" format. Supports all standard npm version specifications:

[dependencies]
# Latest version
react = "latest"

# Specific version
lodash = "4.17.21"

# Semver ranges
typescript = "^5.0.0"
next = "~14.0.0"

# Beta/prerelease
vue = "3.4.0-beta.1"

Complete Example

# Interoper.toml
package-manager = "pnpm"

[dependencies]
# UI Framework
daisyui = "latest"
tailwindcss = "^3.3.0"

# Utilities
lodash = "^4.17.21"
date-fns = "^2.30.0"

# Development tools
typescript = "^5.1.0"
// build.rs
fn main() {
    // Run interoper to resolve Node.js dependencies
    if let Err(e) = interoper::build() {
        panic!("Interoper build failed: {}", e);
    }
    
    // Continue with other build steps...
    println!("cargo:rerun-if-changed=Interoper.toml");
}

Requirements

  • Rust 1.70.0 or later
  • At least one supported package manager (npm, pnpm, yarn, or bun) installed on your system
  • Node.js (required by most package managers)

License

This project is licensed under the MIT License.

Commit count: 0

cargo fmt