Comparing version 0.5.3 to 1.0.0
{ | ||
"name": "ssn", | ||
"version": "0.5.3", | ||
"version": "1.0.0", | ||
"description": "Validate and generate fake SSN", | ||
"main": "index.js", | ||
"main": "built/index.js", | ||
"files": [ | ||
"built/" | ||
], | ||
"scripts": { | ||
"test": "make test" | ||
"test": "mocha" | ||
}, | ||
@@ -26,9 +29,9 @@ "repository": { | ||
"dependencies": { | ||
"sprintf": ">= 0.1.4" | ||
"@types/node": "^6.0.58" | ||
}, | ||
"homepage": "https://github.com/winfinit/fake-ssn-node", | ||
"devDependencies": { | ||
"mocha": "^1.21.4", | ||
"chai": "^1.9.1" | ||
"mocha": "^3.2.0", | ||
"chai": "^3.5.0" | ||
} | ||
} |
@@ -15,22 +15,13 @@ # fake-ssn-node | ||
## Usage | ||
## Synopsis | ||
```javascript | ||
// Generate SSN from random state | ||
var ssn = require('ssn'); | ||
console.log(ssn.generate()); | ||
let {ParseSSN, RandomSSN} = require('ssn'); | ||
let randomSSN = new RandomSSN(); | ||
console.log("SSN string:", randomSSN.value().toString()); //023121234 | ||
console.log("SSN formatted string", randomSSN.value().toFormattedString()); //023-12-1234 | ||
console.log("SSN state", randomSSN.value().state().toString()); // FL | ||
// Generate SSN from state of FL | ||
console.log(ssn.generate('FL')); | ||
// Validate social security | ||
if ( ssn.validate('420-19-4933') ) { | ||
console.log('valid'); | ||
} else { | ||
console.log('invalid'); | ||
} | ||
// Get a state where SSN was issued | ||
var state = ssn.validate('420-19-4933'); | ||
console.log('420-19-4933 was issued in', state); | ||
let parseSSN = new ParseSSN('516386083'); | ||
console.log("SSN state", parseSSN.ssn().state().toString()); | ||
``` | ||
@@ -44,2 +35,54 @@ | ||
## API | ||
### RandomSSN(stateANSI?: string) | ||
Class generates random social security number, optionally accepts state ANSI string (Ex. FL, NY, etc.). | ||
```javascript | ||
let randomSSN = new RandomSSN(); | ||
let randomSSNFromState = new RandomSSN('FL'); | ||
let ssnString = randomSSN.value().toString(); | ||
let stateANSIString = randomSSN.value().state().toString(); | ||
``` | ||
#### value(): SSN | ||
Method returning generated SSN object | ||
---- | ||
### ParseSSN(ssnString: string) | ||
Class parsing SSN string and performs validity of SSN, if SSN is invalid, RangeError exception is thrown. | ||
```javascript | ||
let parseSSN = new ParseSSN('516386083'); | ||
let ssnString = parseSSN.value().toString(); | ||
``` | ||
#### value(): SSN | ||
Method returning generated SSN object | ||
---- | ||
### SSN(state: SSNState, ssn: string) | ||
Class with helper methods to deal with SSN string | ||
#### toFormattedString(): string | ||
Returns formatted SSN string 'xxx-xx-xxxx' | ||
#### toString(): string | ||
Returns SSN in a string format 'xxxxxxxxx' | ||
#### state(): SSNState | ||
Returns SSNState object | ||
---- | ||
### SSNState(state: string) | ||
Class helping to deal with states in relation to SSN | ||
#### toString(): string | ||
Return ANSI string for state | ||
## Contributing | ||
@@ -59,2 +102,3 @@ | ||
* 0.5.3 fixed bug with random states selection | ||
* 1.0.0 rewrite of a module in TS | ||
@@ -61,0 +105,0 @@ ## Legal |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
42688
0
100
297
0
117
5
1
+ Added@types/node@^6.0.58
+ Added@types/node@6.14.13(transitive)
- Removedsprintf@>= 0.1.4
- Removedsprintf@0.1.5(transitive)