pad
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "pad", | ||
"description": "Left and right string padding", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "David Worms <david@adaltas.com>", | ||
@@ -13,5 +13,5 @@ "contributors": [ | ||
"devDependencies": { | ||
"coffee-script": "^1.11.1", | ||
"mocha": "^3.1.2", | ||
"should": "^11.1.1" | ||
"coffee-script": "^1.12.4", | ||
"mocha": "^3.2.0", | ||
"should": "^11.2.0" | ||
}, | ||
@@ -21,2 +21,3 @@ "engines": { | ||
}, | ||
"homepage": "https://github.com/adaltas/node-pad", | ||
"keywords": [ | ||
@@ -30,3 +31,3 @@ "pad", | ||
"type": "git", | ||
"url": "https://github.com/wdavidw/node-pad.git" | ||
"url": "https://github.com/adaltas/node-pad.git" | ||
}, | ||
@@ -33,0 +34,0 @@ "scripts": { |
@@ -1,14 +0,31 @@ | ||
[![Build Status](https://secure.travis-ci.org/wdavidw/node-pad.png)](http://travis-ci.org/wdavidw/node-pad) | ||
Node Pad is a simple function to pad strings in both left and right directions. | ||
# Node.js pad | ||
## Exemples | ||
[![Build Status](https://secure.travis-ci.org/adaltas/node-pad.png)](http://travis-ci.org/adaltas/node-pad) | ||
Node Pad is a simple and elegant function to pad strings in both left and right directions. | ||
## Usage | ||
```javascript | ||
pad('pad', 5) # "pad " | ||
pad(5, 'pad') # " pad" | ||
pad('pad', 5, '+') # "pad++" | ||
pad(5, 'pad', '+') # "++pad" | ||
pad('pad', 5) // "pad " | ||
pad(5, 'pad') // " pad" | ||
pad('pad', 5, '+') // "pad++" | ||
pad(5, 'pad', '+') // "++pad" | ||
``` | ||
## Options | ||
Options are provided as a third argument and are all optional. A string argument | ||
it is interpreted as the "char" option. Accepted options include: | ||
* `char` (string) | ||
The character used to fill the gap. | ||
* `colors` (boolean) | ||
Ajust to hidden terminal color characters, you may also use | ||
`require 'pad/lib/colors'` to avoid passing this option. | ||
* `strip` (boolean) | ||
Remove characters from text if length smaller than text length, default to | ||
"false". | ||
## Left padding: `pad(length, text, [options])` | ||
@@ -34,16 +51,2 @@ | ||
## Options | ||
Options are provided as a third argument and are all optional. A string argument | ||
it is interpreted as the "char" option. Accepted options include: | ||
* `char` (string) | ||
The character used to fill the gap. | ||
* `colors` (boolean) | ||
Ajust to hidden terminal color characters, you may also use | ||
`require 'pad/lib/colors'` to avoid passing this option. | ||
* `strip` (boolean) | ||
Remove characters from text if length smaller than text length, default to | ||
"false". | ||
## Installing | ||
@@ -50,0 +53,0 @@ |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5766
0
74