babel-plugin-transform-bluebird
replace Promise with bluebird plugin.
Installation
npm install bluebird babel-plugin-transform-bluebird --save
Example
In
Promise
Out
;_Promise;
Support syntax
new Promise
Promise.resolve
Promise.reject
Promise.all
Promise.race
doStuff(Promise)
But, syntax instanceof Promise
/ any === Promise
doesn't transform.
And if the Promise
is already import in file, the file does not transform.
// does not transformfoo instanceof Promise // does not transformfoo === Promise // does not transform;Promise;
Usage
.babelrc
(Recommended)
Via .babelrc
Via CLI
$ babel --plugins transform-bluebird script.js
Via Node API
;
Development
Requirement global
- NodeJS v5.11.0
- Npm v3.8.6
git clone https://github.com/59naga/babel-plugin-transform-bluebirdcd babel-plugin-transform-bluebirdnpm install npm test