babel-preset-stage-0

raw JSON →
6.24.1 verified Sat Apr 25 auth: no javascript deprecated

Babel preset that enables all stage 0 (strawman) JavaScript proposal plugins. Version 6.24.1 is the latest stable release; this package is part of Babel 6 and has been deprecated in favor of individual proposal plugins or @babel/preset-env with targets. It includes plugins for syntactic proposals like do-expressions, pipeline operator, and throw expressions. No longer maintained; users should migrate to Babel 7/8 and use specific plugins.

error Error: Cannot find module 'babel-preset-stage-0'
cause Package not installed or version mismatch
fix
npm install --save-dev babel-preset-stage-0@6.24.1
error Error: Plugin/Preset files are not allowed to export objects, only functions.
cause Using an older Babel 6 preset with Babel 7
fix
Upgrade to @babel/preset-stage-0 or use Babel 6
error TypeError: (intermediate value) is not a function
cause Babel 7 dropped support for stage presets
fix
Migrate to @babel/preset-env and individual plugins
deprecated babel-preset-stage-0 is deprecated in Babel 7+
fix Use @babel/preset-env with specific targets or individual plugins.
breaking Stage presets are removed in Babel 8
fix Migrate to @babel/preset-env and explicit plugin configuration.
gotcha Including stage-0 enables unstable proposals that may change or be removed
fix Pin exact Babel version and update proposals carefully.
deprecated Stage presets depend on deprecated babel-preset-stage-1, -2, -3
fix Remove stage presets and use individual plugins for needed proposals.
npm install babel-preset-stage-0
yarn add babel-preset-stage-0
pnpm add babel-preset-stage-0

Shows how to install and configure the stage-0 preset, then use a pipeline operator (stage-0 proposal).

// Install: npm install --save-dev babel-preset-stage-0
// .babelrc
{
  "presets": ["stage-0"]
}

// Example JS with stage-0 features
// Pipeline operator: 2 |> double |> square
const double = x => x * 2;
const square = x => x * x;
const result = 2 |> double |> square;
console.log(result); // 16