phones
Advanced tools
Comparing version 0.1.0 to 1.0.0
{ | ||
"name": "phones", | ||
"version": "0.1.0", | ||
"description": "JS library for parsing and formatting phone numbers", | ||
"main": "./src", | ||
"main": "index.js", | ||
"version": "1.0.0", | ||
"description": "Parse, format, and validate US phone numbers", | ||
"license": "MIT", | ||
"repository": "bendrucker/phones", | ||
"author": { | ||
"name": "Ben Drucker", | ||
"email": "bvdrucker@gmail.com", | ||
"url": "bendrucker.me" | ||
}, | ||
"scripts": { | ||
"test": "istanbul cover node_modules/.bin/_mocha -- ./test" | ||
"test": "standard && tape test.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/bendrucker/phones.git" | ||
}, | ||
"keywords": [ | ||
"phone", | ||
"number", | ||
"international" | ||
"phones", | ||
"us", | ||
"american" | ||
], | ||
"author": "Ben Drucker <bvdrucker@gmail.com> (http://www.bendrucker.me/)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/bendrucker/phones/issues" | ||
"devDependencies": { | ||
"tape": "^4.0.0", | ||
"standard": "^4.0.0" | ||
}, | ||
"homepage": "https://github.com/bendrucker/phones", | ||
"devDependencies": { | ||
"chai": "^1.9.2", | ||
"istanbul": "~0.3.2", | ||
"mocha": "^2.0.1" | ||
"files": [ | ||
"index.js" | ||
], | ||
"dependencies": { | ||
"separate": "~1.0.0" | ||
} | ||
} |
@@ -1,4 +0,66 @@ | ||
phones | ||
====== | ||
# phones [![Build Status](https://travis-ci.org/bendrucker/phones.svg?branch=master)](https://travis-ci.org/bendrucker/phones) | ||
JS library for parsing and formatting phone numbers | ||
> Parse, format, and validate US phone numbers | ||
## Install | ||
``` | ||
$ npm install --save phones | ||
``` | ||
## Usage | ||
```js | ||
var phones = require('phones') | ||
phones.parse('415-555-1234') | ||
//=> 4155551234 | ||
phones.format('4155551234') | ||
//=> 415 555 1234 | ||
phones.validate('4155551234') | ||
//=> true | ||
``` | ||
## API | ||
#### `phones.parse(phone)` -> `string` | ||
##### phone | ||
*Required* | ||
Type: `string` | ||
A phone number to parse. A leading `1` country code will be stripped. | ||
#### `phones.format(phone, [separator])` -> `string` | ||
Format a 10 digit phone string by adding separators. | ||
##### phone | ||
*Required* | ||
Type: `string` | ||
A phone number to format. Digits only. | ||
##### separator | ||
Type: `string` | ||
Default: `' '` | ||
#### `phones.validate(phone)` -> `boolean` | ||
#### phone | ||
*Required* | ||
Type: `string` | ||
A phone number to validate as a 10 digit string. | ||
## License | ||
MIT © [Ben Drucker](http://bendrucker.me) |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
0
67
3144
1
4
14
+ Addedseparate@~1.0.0
+ Addedcast-array@1.0.1(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedseparate@1.0.1(transitive)