New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

stringpad

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stringpad - npm Package Compare versions

Comparing version
0.0.2
to
1.0.0
+2
-2
index.js
'use strict';
var pad = {
var stringpad = {
left: function(str, len, ch) {

@@ -95,2 +95,2 @@ var cache = ['', ' ', ' ', ' ', ' ', ' '];

module.exports = pad;
module.exports = stringpad;
{
"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---'``