# p-after

> Resolve a promise after an amount of time with specified data

Latest version **1.0.1** (published 2020-10-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install p-after
pnpm add p-after
yarn add p-after
bun add p-after
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-10-21 |
| First published | 2020-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nicholai Nissen |
| Maintainers | nicholai |
| Keywords | promise, after, delay, time, sequence |

## Links

- npm: https://www.npmjs.com/package/p-after
- Repository: https://github.com/Nicholaiii/p-after
- Homepage: https://github.com/Nicholaiii/p-after#readme
- Issues: https://github.com/Nicholaiii/p-after/issues
- npm.io page: https://npm.io/package/p-after

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-10-21

## README

# p-after 
[![Build Status](https://travis-ci.com/Nicholaiii/p-after.svg?branch=main)](https://travis-ci.com/Nicholaiii/p-after)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

> Resolve a promise with specified data after an amount of time

Useful if you want to return data after some time, for example, if you want to sequence data at varying rates.

## Usage
```ts
const after = require('p-after')
(async () => {
  const result = await after(1000, 'OK')
  // After one second, the promise resolves with 'OK'. 
})
```

## API

### pAfter(when, what)

#### when
Type: `number`

The amount of time to delay returning the data.

#### what
Type: `any`

The data to return after delay.

## Related
- [delay](https://github.com/sindresorhus/delay) - Delay a promise a specified amount of time
- [p-min-delay](https://github.com/sindresorhus/p-min-delay) - Delay an existing promise a minimum amount of time
- [p-immediate](https://github.com/sindresorhus/p-immediate) - Returns a promise resolved in the next event loop - think `setImmediate()`
- [p-timeout](https://github.com/sindresorhus/p-timeout) - Timeout a promise after a specified amount of time
- [More…](https://github.com/sindresorhus/promise-fun)

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