2.0.2 ā¢ Published 2 years ago
@putout/plugin-apply-top-level-await v2.0.2
@putout/plugin-apply-top-level-await
š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