Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

left-pad

Package Overview
Dependencies
0
Maintainers
3
Versions
15
Issues
File Explorer

Advanced tools

left-pad

String left pad

    1.3.0latest
    GitHub
    npm

Version published
Maintainers
3
Weekly downloads
2,174,082
increased by7.04%

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

FAQs

Last updated on 09 Apr 2018

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
Socket SOC 2 Logo

Product

  • Package Issues
  • 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