bpm-bundle
raw JSON → 2.1.0 verified Sat Apr 25 auth: no javascript
Episode bundler for brainpm (BPM), the package manager for the brain. Version 2.1.0 is the latest stable. Transforms an episode repository (including package.json) into publishable file bundles for distribution via bpm-github or other publishers. Part of the BPM ecosystem, specialized for brain package format; no direct alternatives.
Common errors
error Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'bpm-bundle' ↓
cause Package not installed or wrong import path in ESM context
fix
Run npm install bpm-bundle and use import syntax.
error TypeError: bundle is not a function ↓
cause Using named import when importing as default
fix
Use import bundle from 'bpm-bundle' instead of import { bundle } from 'bpm-bundle'.
error SyntaxError: Unexpected token 'export' ↓
cause Using ESM syntax in a CommonJS file
fix
Add "type": "module" to package.json or use require with dynamic import.
Warnings
breaking Import syntax changed from CommonJS to ESM in v2.0. require() throws error. ↓
fix Use import instead of require().
deprecated The 'bundleFormat' option was renamed to 'format' in v2.0. ↓
fix Use 'format' instead of 'bundleFormat'.
gotcha bpm-bundle expects a valid brainpm package.json. Missing 'brainpm' field causes silent failure. ↓
fix Ensure package.json includes a 'brainpm' configuration object.
Install
npm install bpm-bundle yarn add bpm-bundle pnpm add bpm-bundle Imports
- default wrong
const bundle = require('bpm-bundle')correctimport bundle from 'bpm-bundle' - bundle wrong
import bundle from 'bpm-bundle' (if using named export)correctimport { bundle } from 'bpm-bundle' - type BundleOptions wrong
import { BundleOptions } from 'bpm-bundle' (runtime error, only a type)correctimport type { BundleOptions } from 'bpm-bundle'
Quickstart
import bundle from 'bpm-bundle';
import { readFileSync, writeFileSync } from 'fs';
const episodePath = './my-episode';
const options = { format: 'github', version: '2.1.0' };
try {
const result = bundle(episodePath, options);
console.log('Bundled files:', Object.keys(result));
writeFileSync('./dist/bundle.zip', result.zip);
} catch (err) {
console.error('Bundling failed:', err);
}