$ cnpm install @putout/plugin-apply-top-level-await
????Putout plugin applies top-level-await. Part of @putout/promises.
npm i @putout/plugin-apply-top-level-await
{
"rules": {
"apply-top-level-await": "on"
}
}
import fs from 'fs';
(async () => {
const data = await fs.promises.readFile('hello.txt');
})();
import fs from 'fs';
const data = await fs.promises.readFile('hello.txt');
MIT
Copyright 2013 - present © cnpmjs.org | Home |