Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keyvan-m-sadeghi/babel-plugin-transform-util-promisify
Transforms util.promisify for node versions < 8
https://github.com/keyvan-m-sadeghi/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/keyvan-m-sadeghi/babel-plugin-transform-util-promisify
- Owner: keyvan-m-sadeghi
- License: mit
- Created: 2018-02-27T08:00:23.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T09:52:40.000Z (almost 7 years ago)
- Last Synced: 2024-12-14T17:16:47.664Z (about 1 month ago)
- Topics: babel, babel-plugin, promise, promisify
- Language: JavaScript
- Size: 19.5 KB
- Stars: 2
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/babel-plugin-transform-util-promisify.svg)](https://www.npmjs.com/package/babel-plugin-transform-util-promisify)
[![Build Status](https://travis-ci.org/assister-ai/babel-plugin-transform-util-promisify.svg?branch=master)](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)