Cush
raw JSON → 0.2.3 verified Sat Apr 25 auth: no javascript maintenance
Cush is a modern module bundler for Node.js (>=9) focused on eager bundling, symlink-friendly resolution, and approachable configuration. Version 0.2.3 is the latest stable release, with an experimental API and limited adoption. It features automatic plugin installation, a worker farm for heavy tasks, and a simple plugin API. Differentiators include its use of wch for file watching and symlink support, though it is less mature compared to webpack or rollup.
Common errors
error Error: Cannot find module 'cush' ↓
cause Missing or incorrect install path.
fix
Run 'npm install cush' at project root.
error TypeError: (0 , cush.bundle) is not a function ↓
cause Using CommonJS require instead of ESM import.
fix
Use 'import { bundle } from 'cush'' in an ESM context.
Warnings
gotcha Cush requires Node.js >=9, but ESM support may be incomplete in older versions. ↓
fix Upgrade Node.js to >=12 for full ESM compatibility.
deprecated The plugin API is experimental and may change in breaking ways. ↓
fix Pin to a specific version and monitor the plugin API changes.
gotcha Automatic plugin installation may fetch unexpected versions; use package.json resolutions. ↓
fix Explicitly specify plugin versions in configuration or package.json.
Install
npm install cush yarn add cush pnpm add cush Imports
- bundle wrong
const bundle = require('cush').bundlecorrectimport { bundle } from 'cush' - FileInfo
import { FileInfo } from 'cush' - Plugin
import type { Plugin } from 'cush'
Quickstart
import { bundle, Config } from 'cush';
const config: Config = {
entry: './src/index.ts',
output: './dist/bundle.js',
plugins: ['typescript', 'resolve'],
};
bundle(config).then(() => {
console.log('Bundled successfully');
}).catch(err => {
console.error('Bundle failed:', err);
});