pad-end

1.0.2 • Public • Published

pad-end Version Badge

ES7 spec-compliant String.prototype.padEnd shim.

MIT License

build:? coverage:?

Install

$ npm install --save pad-end 

Usage

For more use-cases see the tests

 
// a polyfill that doesn't overwrite the native method
 
var padEnd = require('pad-end');
 
padEnd('x', 4, 'ab');        // => 'xaba'
padEnd('x', 4);              // => 'x   '
padEnd('abcd', 2, '#');      // => 'abcd'
padEnd('abcd', 6, '123456'); // => 'abcd12'
 

Related

  • pad-start - ES spec-compliant String.prototype.padStart 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.

Dependents (7)

Package Sidebar

Install

npm i pad-end

Weekly Downloads

1,634

Version

1.0.2

License

MIT

Last publish

Collaborators

  • bubkoo