# next-power-of-two

> returns the next highest power of two

Latest version **1.0.0** (published 2015-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install next-power-of-two
pnpm add next-power-of-two
yarn add next-power-of-two
bun add next-power-of-two
```

## 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.0 |
| Published | 2015-05-25 |
| First published | 2015-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | power, of, two, next, highest, greatest, pot, 2 |

## Links

- npm: https://www.npmjs.com/package/next-power-of-two
- Repository: https://github.com/mattdesl/next-power-of-two
- Issues: https://github.com/mattdesl/next-power-of-two/issues
- npm.io page: https://npm.io/package/next-power-of-two

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-05-25

## README

# next-power-of-two

[![frozen](http://badges.github.io/stability-badges/dist/frozen.svg)](http://github.com/badges/stability-badges)

For a positive number, returns the next highest power of two.

```js
var nextPOT = require('next-power-of-two')

nextPOT(100) === 128
nextPOT(50)  === 64
nextPOT(8)   === 8
```

## Usage

[![NPM](https://nodei.co/npm/next-power-of-two.png)](https://www.npmjs.com/package/next-power-of-two)

#### `nextPowerOfTwo(number)`

For the positive `number`, returns the next highest power of two value. If `number` is a power of two, it will be returned.

If `number` is zero, `1` is returned. Negative numbers produce undefined results.

## See Also

- [is-power-of-two](https://www.npmjs.com/package/is-power-of-two)

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/next-power-of-two/blob/master/LICENSE.md) for details.

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