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.

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.
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.
npm install bpm-bundle
yarn add bpm-bundle
pnpm add bpm-bundle

Demonstrates importing the default bundler, reading an episode, and writing the output zip file.

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);
}