7.0.0-beta.3 • Published 8 years ago
babel-plugin-transform-throw-expressions v7.0.0-beta.3
babel-plugin-transform-throw-expressions
This plugin transforms Throw Expressions into an IIFE.
Example
function test(param = throw new Error('required!')) {
const test = param === true || throw new Error('Falsey!');
}Installation
npm install --save-dev babel-plugin-transform-throw-expressionsUsage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["transform-throw-expressions"]
}Via CLI
babel --plugins transform-throw-expressions script.jsVia Node API
require("babel-core").transform("code", {
plugins: ["transform-throw-expressions"]
});References
7.0.0-beta.3
8 years ago