0.0.2 • Published 10 years ago

string-just v0.0.2

Weekly downloads
1,089
License
MIT
Repository
github
Last release
10 years ago

string-just

Add Ruby ljust/rjust methods to JavaScript String

Installation

Install with npm:

$ npm install string-just

Install with component:

$ component install MisumiRize/js-string-just

Example

Basic

var just = require('just');

just.ljust('test', 10);       // => 'test      '
just.rjust('test', 10);       // => '      test'

just.ljust('test', 10, 'a');  // => 'testaaaaaa'

Polyfill

just();

'test'.ljust(10);  // => 'test     '