Registry / devops / buble
library0.20.0jsnpmunverified

Bublé is a fast ES2015+ to ES5 compiler that requires zero configuration. Version 0.20.0 is current but in maintenance mode. It was designed before modern browsers supported ES2015, and now only recommended for IE11 compatibility. Unlike Babel, Bublé does not require plugins or presets, making it simpler but less extensible. It supports ES2015 features like arrow functions, template literals, destructuring, and let/const, plus some ES2016/ES2017 features (exponentiation, async/await). No new features will be added; only bugfixes.

npm install buble
INSTALL
IMPORT
SIG · BUBLE
B
buble
devopsjavascriptv0.20.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (transform)
const buble = require('buble'); buble.transform(source);
import buble from 'buble';
Bublé does not ship ES module; use CommonJS require() for Node compatibility.
transform
const { transform } = require('buble');
import { transform } from 'buble';
Named import from CJS is fine, but ESM import fails due to missing .mjs entry.
buble (CLI)
const exec = require('child_process').execSync('buble input.js');
import buble from 'buble';
CLI tool is separate from npm package; install globally with -g.

Shows basic usage of Bublé's transform function: compile arrow function to ES5, disable module transformation.

const buble = require('buble'); const result = buble.transform('const x = () => 1;', { transforms: { modules: false }, source: 'input.js' }); console.log(result.code); // 'var x = function () { return 1; };'
buble --version
Debug
Known issues
deprecatedBublé is in maintenance mode; no new features will be added.
fix
Consider Babel or SWC for modern needs unless IE11 support is required.
affects: >=0.20.0
breakingIn v0.17+, the 'acorn' dependency changed; custom acorn plugins may break.
fix
Update userland plugins to be compatible with acorn 5+.
affects: >=0.17.0
gotchaBublé does not support dynamic import() or optional chaining.
fix
Use Babel or TypeScript for those features.
affects: >=0.20.0
gotchaSource maps require magic-string; ensure it is installed.
fix
npm install magic-string@^0.25.0 as a dependency.
affects: >=0.20.0
Errors
Common errors & fixes
Error: Cannot find module 'acorn'
Missing acorn dependency (Bublé uses it internally).
fix
Run `npm install buble` which includes acorn as a dependency.
TypeError: buble.transform is not a function
Invalid import: trying to use ES import syntax on CJS module.
fix
Use `const buble = require('buble');` instead of `import buble from 'buble';`.
SyntaxError: Unexpected token (1:6): import statement
Bublé does not support transforming import/export statements by default.
fix
Add option `transforms: { modules: false }` or use Babel for ES modules.
Upgrade
Version history
0.20.0latest on npm
Audit
Dependencies
acornrequiredused for JavaScript parsing
acorn-jsxoptionalsupports JSX syntax if needed
magic-stringrequiredfor source map generation
Agent activity
7 hits · last 30 days
node
6
Resources
buble — npm install buble · libregistry