cf-left-pad

String left pad.

Usage no npm install needed!

<script type="module">
  import cfLeftPad from 'https://cdn.skypack.dev/cf-left-pad';
</script>

README

cf-left-pad

String left pad.

Install

$ npm install cf-left-pad

Usage

leftpad = require('cf-left-pad')

leftpad('foo', 5)
// => "  foo"

leftpad('foobar', 6)
// => "foobar"

leftpad(1, 2, 0)
// => "01"