This commit is contained in:
hatuhn
2019-09-13 09:45:04 +07:00
parent f14a34ba19
commit 558fb07261
16790 changed files with 0 additions and 1642370 deletions

View File

@@ -1,4 +0,0 @@
node_modules
*.log
src
test

View File

@@ -1,60 +0,0 @@
# babel-plugin-transform-async-to-generator
> Turn async functions into ES2015 generators
## Example
**In**
```javascript
async function foo() {
await bar();
}
```
**Out**
```javascript
var _asyncToGenerator = function (fn) {
...
};
var foo = _asyncToGenerator(function* () {
yield bar();
});
```
## Installation
```sh
npm install --save-dev babel-plugin-transform-async-to-generator
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["transform-async-to-generator"]
}
```
### Via CLI
```sh
babel --plugins transform-async-to-generator script.js
```
### Via Node API
```javascript
require("babel-core").transform("code", {
plugins: ["transform-async-to-generator"]
});
```
## References
* [Proposal: Async Functions for ECMAScript](https://github.com/tc39/ecmascript-asyncawait)

View File

@@ -1,27 +0,0 @@
"use strict";
exports.__esModule = true;
exports.default = function () {
return {
inherits: require("babel-plugin-syntax-async-functions"),
visitor: {
Function: function Function(path, state) {
if (!path.node.async || path.node.generator) return;
(0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, {
wrapAsync: state.addHelper("asyncToGenerator")
});
}
}
};
};
var _babelHelperRemapAsyncToGenerator = require("babel-helper-remap-async-to-generator");
var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports["default"];

View File

@@ -1,47 +0,0 @@
{
"_from": "babel-plugin-transform-async-to-generator@^6.24.1",
"_id": "babel-plugin-transform-async-to-generator@6.24.1",
"_inBundle": false,
"_integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
"_location": "/babel-plugin-transform-async-to-generator",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "babel-plugin-transform-async-to-generator@^6.24.1",
"name": "babel-plugin-transform-async-to-generator",
"escapedName": "babel-plugin-transform-async-to-generator",
"rawSpec": "^6.24.1",
"saveSpec": null,
"fetchSpec": "^6.24.1"
},
"_requiredBy": [
"/babel-preset-stage-3"
],
"_resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
"_shasum": "6536e378aff6cb1d5517ac0e40eb3e9fc8d08761",
"_spec": "babel-plugin-transform-async-to-generator@^6.24.1",
"_where": "/Applications/XAMPP/xamppfiles/htdocs/wordpress/t-latehome/wp-content/plugins/opal-estate-pro/node_modules/babel-preset-stage-3",
"bundleDependencies": false,
"dependencies": {
"babel-helper-remap-async-to-generator": "^6.24.1",
"babel-plugin-syntax-async-functions": "^6.8.0",
"babel-runtime": "^6.22.0"
},
"deprecated": false,
"description": "Turn async functions into ES2015 generators",
"devDependencies": {
"babel-helper-plugin-test-runner": "^6.24.1"
},
"keywords": [
"babel-plugin"
],
"license": "MIT",
"main": "lib/index.js",
"name": "babel-plugin-transform-async-to-generator",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator"
},
"version": "6.24.1"
}