@niocn/plugin-transform-arrow-functions
v0.1.5
Published
plugin-transform-arrow-functions
Downloads
3
Maintainers
Readme
@niocn/plugin-transform-arrow-functions
@niocn/plugin-transform-arrow-functions
Installation
$ npm install @niocn/plugin-transform-arrow-functions
-D
# or yarn
$ yarn add @niocn/plugin-transform-arrow-functions -D
Usage
const pluginTransformArrowFunctions = require('plugin-transform-arrow-functions');
const babelCore = require('@babel/core');
const babelTypes = require('@babel/types');
const source = `
const sum = (a, b) => {
return a + b
}
`;
const result = babelCore.transform(source, {
plugins: [pluginTransformArrowFunctions],
});