# caffeinate

> Prevent the system from going to sleep

Latest version **1.0.1** (published 2017-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install caffeinate
pnpm add caffeinate
yarn add caffeinate
bun add caffeinate
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-02-25 |
| First published | 2016-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rogerbf |
| Maintainers | rogerbf |
| Keywords | sleep, macOS, utility |

## Links

- npm: https://www.npmjs.com/package/caffeinate
- Repository: https://github.com/rogerbf/caffeinate
- Homepage: https://github.com/rogerbf/caffeinate#readme
- Issues: https://github.com/rogerbf/caffeinate/issues
- npm.io page: https://npm.io/package/caffeinate

## Dependencies (1)

- [options-to-args](https://npm.io/package/options-to-args.md) ^0.0.1

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-02-25
- 1.0.0 — 2017-02-25
- 0.1.0 — 2016-09-17
- 0.0.1 — 2016-09-02

## README

# caffeinate

`caffeinate` is a system utility provided in macOS which prevents the system from sleeping indefinitely or on behalf of a utility.

## usage

```javascript
const caffeinate = require(`caffeinate`)

caffeinate({ pid: 45623 })
.then(caffeinatePid => console.log(caffeinatePid))
.catch(error => console.log(error))
```

## api

### `caffeinate([options])`

Spawns caffeinate. Resolves with the pid of the spawned caffeinate instance.

`options` can be any of those supported by caffeinate. For the sake of readability you can use `timeout` and `pid` in place of `t` and `w` respectively.

[options-to-args](https://www.npmjs.com/package/options-to-args) handles the conversion of options into spawn args.

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