pad-start

ES spec-compliant String.prototype.padStart shim.

MIT 4 个版本
安装
npm install pad-start
yarn add pad-start
pnpm add pad-start
bun add pad-start
README

pad-start Version Badge

ES spec-compliant String.prototype.padStart shim.

MIT License

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.

版本列表
1.0.2 2016-04-15
1.0.1 2016-04-12
1.0.0 2016-04-12
0.0.0 2016-04-11