# zero-fill

> Zero-fill a number to the given size.

Latest version **2.2.4** (published 2020-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install zero-fill
pnpm add zero-fill
yarn add zero-fill
bun add zero-fill
```

## 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 | 2.2.4 |
| Published | 2020-07-17 |
| First published | 2014-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross |
| Keywords | zero, zero fill, fill, zerofill, pad, 0, zero pad, zeropad, string, number |

## Links

- npm: https://www.npmjs.com/package/zero-fill
- Repository: https://github.com/feross/zero-fill
- Homepage: https://github.com/feross/zero-fill#readme
- Issues: https://github.com/feross/zero-fill/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/zero-fill

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 2.2.4 (latest) — 2020-07-17
- 2.2.3 — 2016-03-11
- 2.2.2 — 2016-02-10
- 2.2.1 — 2015-05-05
- 2.2.0 — 2015-03-05
- 2.1.0 — 2014-12-17
- 2.0.0 — 2014-12-17
- 1.0.0 — 2014-03-22

## README

# zero-fill [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/zero-fill/master.svg
[travis-url]: https://travis-ci.org/feross/zero-fill
[npm-image]: https://img.shields.io/npm/v/zero-fill.svg
[npm-url]: https://npmjs.org/package/zero-fill
[downloads-image]: https://img.shields.io/npm/dm/zero-fill.svg
[downloads-url]: https://npmjs.org/package/zero-fill
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

### Zero-fill a number to the given size.

![zero](https://raw.githubusercontent.com/feross/zero-fill/master/img.png)

## install

```
npm install zero-fill
```

## usage

```js
var zeroFill = require('zero-fill')

zeroFill(4, 1) // '0001'
zeroFill(10, 55) // '0000000055'
zeroFill(1, 1) // '1'
```

Partial application:

```js
zeroFill(4)(1) // '0001'
```

Custom padding character:

```js
zeroFill(4, 55, ' ')  // '  55'
zeroFill(4, 500, ' ') // ' 500'
```

## license

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).

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