https://github.com/2bigo/babel-plugin-transform-util-promisify
Transforms util.promisify for node versions < 8
https://github.com/2bigo/babel-plugin-transform-util-promisify
babel babel-plugin promise promisify
Last synced: about 1 month ago
JSON representation
Transforms util.promisify for node versions < 8
- Host: GitHub
- URL: https://github.com/2bigo/babel-plugin-transform-util-promisify
- Owner: 2bigO
- License: mit
- Created: 2018-02-27T08:00:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T09:52:40.000Z (over 8 years ago)
- Last Synced: 2025-06-26T04:37:40.804Z (12 months ago)
- Topics: babel, babel-plugin, promise, promisify
- Language: JavaScript
- Size: 19.5 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/babel-plugin-transform-util-promisify)
[](https://travis-ci.org/assister-ai/babel-plugin-transform-util-promisify)
# 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
```shell
npm install babel-plugin-transform-util-promisify --save-dev
```
## Usage
Add at the top of plugins in `.babelrc`:
```json
{
"plugins": [
"transform-util-promisify"
],
"presets": [
["env", {
"targets": {
"node": "current"
}
}]
]
}
```
The plugin currently transforms code only in these forms:
```js
import { promisify } from 'util';
```
and
```js
const { promisify } = require('promisify');
```
## License
[MIT](https://github.com/assister-ai/babel-plugin-transform-util-promisify/blob/master/LICENSE)