@putout/plugin-apply-top-level-await
putout plugin adds ability to apply top level await
Last updated 5 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-apply-top-level-await 
SYNC missed versions from official npm registry.

@putout/plugin-apply-top-level-await NPM version

🐊Putout plugin applies top-level-await. Part of @putout/promises.

Install

npm i @putout/plugin-apply-top-level-await

Rule

{
    "rules": {
        "apply-top-level-await": "on"
    }
}

❌ Incorrect code example

import fs from 'fs';
(async () => {
    const data = await fs.promises.readFile('hello.txt');
})();

✅ Correct code Example

import fs from 'fs';
const data = await fs.promises.readFile('hello.txt');

License

MIT

Current Tags

  • 2.0.2                                ...           latest (5 years ago)

6 Versions

  • 2.0.2                                ...           5 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 10
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 7
Dependencies (1)
Dev Dependencies (10)

© 2010 - cnpmjs.org x YWFE | Home | YWFE