JSPM

pad-start

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5328
  • Score
    100M100P100Q126429F
  • License MIT

ES spec-compliant String.prototype.padStart shim.

Package Exports

  • pad-start

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pad-start) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pad-start Version Badge

ES spec-compliant String.prototype.padStart shim.

MIT License

build:? coverage:?

Install

$ npm install --save pad-start 

Usage

For more use-cases see the tests

// a polyfill that doesn't overwrite the native method

var padStart = require('pad-start');

padStart('x', 4, 'ab');        // => 'abax'
padStart('x', 4);              // => '   x'
padStart('abcd', 2, '#');      // => 'abcd'
padStart('abcd', 6, '123456'); // => '12abcd'
  • pad-end - ES spec-compliant String.prototype.padEnd shim.
  • start-with - Determines whether a string begins with the characters of another string.
  • end-with - Determines whether a string ends with the characters of another string.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.