+2
-2
| 'use strict'; | ||
| var pad = { | ||
| var stringpad = { | ||
| left: function(str, len, ch) { | ||
@@ -95,2 +95,2 @@ var cache = ['', ' ', ' ', ' ', ' ', ' ']; | ||
| module.exports = pad; | ||
| module.exports = stringpad; |
+1
-1
| { | ||
| "name": "stringpad", | ||
| "version": "0.0.2", | ||
| "version": "1.0.0", | ||
| "description": "Fastest String left,right and center pad", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+11
-11
| # stringpad | ||
| A repository for npm module Pad inspired by Azar's [Leftpad](https://github.com/azer/left-pad) (which recently [broke the internet](http://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/)), with performance improvements and Rightpad and Centerpad option too. | ||
| A repository for npm module stringpad inspired by Azar's [Leftpad](https://github.com/azer/left-pad) (which recently [broke the internet](http://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/)), with performance improvements and Rightpad and Centerpad option too. | ||
@@ -11,21 +11,21 @@ Implemented algorithm used for Javascript's [repeat](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/repeat). Probably the fastest implementation of Azar's Leftpad, with added options. | ||
| Usage: | ||
| pad.left('foo', 5) | ||
| stringpad.left('foo', 5) | ||
| ``' foo'`` | ||
| pad.left('foobar', 6) | ||
| stringpad.left('foobar', 6) | ||
| ``'foobar'`` | ||
| pad.left(1, 2, 0) | ||
| stringpad.left(1, 2, 0) | ||
| ``'01'`` | ||
| pad.left(1, 2, '-') | ||
| stringpad.left(1, 2, '-') | ||
| ``'-1'`` | ||
| pad.right('foo', 5) | ||
| stringpad.right('foo', 5) | ||
| ``'foo '`` | ||
| pad.right('foobar', 6) | ||
| stringpad.right('foobar', 6) | ||
| ``'foobar'`` | ||
| pad.right(1, 2, 0) | ||
| stringpad.right(1, 2, 0) | ||
| ``'10'`` | ||
| pad.right(1, 2, '-') | ||
| stringpad.right(1, 2, '-') | ||
| ``'1-'`` | ||
| pad.center('foo', 5) | ||
| stringpad.center('foo', 5) | ||
| ``' foo '`` | ||
| pad.center('foo', 6, '-') | ||
| stringpad.center('foo', 6, '-') | ||
| ``'---foo---'`` |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4709
1.68%0
-100%