1 unstable release
Uses new Rust 2024
| 0.1.0 | Mar 1, 2026 |
|---|
#429 in Development tools
170KB
4K
SLoC
Dumpling
A fast JavaScript runtime and bundler implemented in Rust.
Features
- 🚀 Fast JavaScript runtime using the Boa engine
- 📦 Package manager functionality
- 📦 Module bundling with support for ES modules, CommonJS, and IIFE formats
- 🔥 Hot module replacement in development mode
- 📁 Advanced module resolution with support for node_modules
- ⚡ Built with Rust for performance and safety
Installation
cargo install dumpling
Usage
Initialize a new project
dumpling init
This creates a new project with:
package.jsonwith basic scriptssrc/index.jsas the entry pointdist/directory for build outputs
Run a JavaScript file
dumpling run src/index.js
Start development server
dumpling dev
Bundle your code
# ES modules format (default)
dumpling bundle src/index.js --output dist/bundle.js
# CommonJS format
dumpling bundle src/index.js --output dist/bundle.js --format cjs
# IIFE format with minification
dumpling bundle src/index.js --output dist/bundle.js --format iife --minify
# With source map
dumpling bundle src/index.js --output dist/bundle.js --sourcemap
Install packages
# Install a package (fetches from npm registry)
dumpling install lodash
# Install as dev dependency
dumpling install typescript --dev
# Install all dependencies from package.json
dumpling install
Run package.json scripts
dumpling run-script build
dumpling run-script test
Configuration
Dumpling uses a package.json file for configuration:
{
"name": "my-project",
"version": "0.1.0",
"scripts": {
"start": "dumpling run src/index.js",
"dev": "dumpling dev",
"build": "dumpling bundle src/index.js --output dist/bundle.js"
},
"dependencies": {
"lodash": "^4.17.21"
},
"devDependencies": {
"typescript": "^4.9.4"
}
}
Module Resolution
Dumpling supports modern JavaScript module resolution:
// Relative imports
import utils from "./utils.js";
import helper from "../helper.js";
// Node modules imports
import _ from "lodash";
import express from "express";
// Dynamic imports
const module = await import("./module.js");
// JSON imports
const data = require("./data.json");
Development
# Clone the repository
git clone https://github.com/yourusername/dumpling.git
cd dumpling
# Build
cargo build
# Run tests
cargo test
# Run in development mode
cargo run -- run examples/hello.js
License
MIT
Dependencies
~35–55MB
~749K SLoC