Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

left-pad

Package Overview
Dependencies
0
Maintainers
3
Versions
15
Issues
File Explorer

Advanced tools

left-pad

String left pad

    1.3.0latest

Version published
Maintainers
3
Yearly downloads
154,639,494
decreased by-28.64%

Weekly downloads

Readme

Source

left-pad

String left pad

Build Status

Install

$ npm install left-pad

Usage

const leftPad = require('left-pad') leftPad('foo', 5) // => " foo" leftPad('foobar', 6) // => "foobar" leftPad(1, 2, '0') // => "01" leftPad(17, 5, 0) // => "00017"

NOTE: The third argument should be a single char. However the module doesn't throw an error if you supply more than one chars. See #28.

NOTE: Characters having code points outside of BMP plan are considered a two distinct characters. See #58.

Keywords

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc