Socket
Socket
Sign inDemoInstall

zero-fill

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    zero-fill

Zero-fill a number to the given size.


Version published
Maintainers
1
Install size
5.60 kB
Created

Readme

Source

zero-fill travis npm downloads javascript style guide

Zero-fill a number to the given size.

zero

install

npm install zero-fill

usage

var zeroFill = require('zero-fill')

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

Partial application:

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

Custom padding character:

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

license

MIT. Copyright (c) Feross Aboukhadijeh.

Keywords

FAQs

Last updated on 17 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc