# import-scheduler

> Dynamic import scheduler

Latest version **0.3.0** (published 2021-10-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install import-scheduler
pnpm add import-scheduler
yarn add import-scheduler
bun add import-scheduler
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2021-10-21 |
| First published | 2020-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 25.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Alexis Munsayac <alexis.munsayac@gmail.com> |
| Maintainers | lxsmnsyc |
| Keywords | pridepack |

## Links

- npm: https://www.npmjs.com/package/import-scheduler
- Repository: https://github.com/lxsmnsyc/import-scheduler
- Issues: https://github.com/lxsmnsyc/import-scheduler/issues
- npm.io page: https://npm.io/package/import-scheduler

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2021-10-21
- 0.2.1 — 2021-05-06
- 0.2.0 — 2021-03-20
- 0.1.4 — 2021-03-13
- 0.1.3 — 2020-12-09
- 0.1.2 — 2020-11-26
- 0.1.1 — 2020-11-26
- 0.1.0 — 2020-11-26

## README

# import-scheduler

> Dynamic import scheduler

[![NPM](https://img.shields.io/npm/v/import-scheduler.svg)](https://www.npmjs.com/package/import-scheduler) [![JavaScript Style Guide](https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript)

## Install

```bash
yarn add import-scheduler
```

## Usage

```ts
import { importForInteractive } from 'import-scheduler';

const LazyComponent = lazy(async () => {
  await importForInteractive();
  return import('./component/lazy');
})
```

Kinds of schedulers:
- `importForDisplay()`: Defers dynamic imports until the `document.readyState` becomes `"interactive"` (`"DOMContentLoaded"`).
- `importForInteractive()`: Defers dynamic imports until the `document.readyState` becomes `"complete"` (`"load"`).
- `importForNextFrame()`: Defers dynamic imports until the next frame.
- `importForTimeout(ms)`: Defers dynamic imports until a set timeout.

## License

MIT © [lxsmnsyc](https://github.com/lxsmnsyc)

---
_Source: https://npm.io/package/import-scheduler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
