# @putout/plugin-apply-top-level-await

> putout plugin adds ability to apply top level await

Latest version **2.0.2** (published 2022-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @putout/plugin-apply-top-level-await
pnpm add @putout/plugin-apply-top-level-await
yarn add @putout/plugin-apply-top-level-await
bun add @putout/plugin-apply-top-level-await
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2022-02-07 |
| First published | 2019-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.3.0 |
| Dependencies | 1 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 795 |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | putout, putout-plugin, plugin, top-level-await |

## Links

- npm: https://www.npmjs.com/package/@putout/plugin-apply-top-level-await
- Repository: https://github.com/coderaiser/putout
- Homepage: https://github.com/coderaiser/putout/tree/v24.5.0/packages/plugin-apply-top-level-await#readme
- Issues: https://github.com/coderaiser/putout/issues
- npm.io page: https://npm.io/package/@putout/plugin-apply-top-level-await

## Dependencies (1)

- [fullstore](https://npm.io/package/fullstore.md) ^3.0.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 2.0.2 (latest) — 2022-02-07
- 2.0.1 — 2020-03-25
- 2.0.0 — 2020-03-08
- 1.0.2 — 2020-02-03
- 1.0.1 — 2019-10-11
- 1.0.0 — 2019-10-11

## README

# @putout/plugin-apply-top-level-await [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-top-level-await.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-top-level-await"npm"

🐊[`Putout`](https://github.com/coderaiser/putout) plugin applies [top-level-await](https://v8.dev/features/top-level-await). Part of [@putout/promises](https://github.com/coderaiser/putout/tree/v24.5.0/packages/plugin-promises).

## Install

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

## Rule

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

## ❌ Incorrect code example

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

## ✅ Correct code Example

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

## License

MIT

---
_Source: https://npm.io/package/@putout/plugin-apply-top-level-await · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
