@putout/plugin-apply-top-level-await
putout plugin adds ability to apply top level await
Last updated 4 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (4 years ago)

6 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |