babel-plugin-transform-util-promisify

0.2.2 • Public • Published

npm version Build Status

babel-plugin-transform-util-promisify

Transforms util.promisify to a function definition for node versions < 8, automatically detects if node version >= 8 and does nothing if so.

Install

npm install babel-plugin-transform-util-promisify --save-dev

Usage

Add at the top of plugins in .babelrc:

{
  "plugins": [
    "transform-util-promisify"
    ],
    "presets": [
      ["env", {
        "targets": {
          "node": "current"
        }
      }]
    ]
}

The plugin currently transforms code only in these forms:

import { promisify } from 'util';

and

const { promisify } = require('promisify');

License

MIT

Package Sidebar

Install

npm i babel-plugin-transform-util-promisify

Weekly Downloads

21

Version

0.2.2

License

MIT

Unpacked Size

23.1 kB

Total Files

12

Last publish

Collaborators

  • keyvan-m-sadeghi