https://github.com/personnummer/js
Validate Swedish personal identity numbers
https://github.com/personnummer/js
hacktoberfest javascript personal-identity-number personnummer social-security-number validation
Last synced: about 1 month ago
JSON representation
Validate Swedish personal identity numbers
- Host: GitHub
- URL: https://github.com/personnummer/js
- Owner: personnummer
- License: mit
- Created: 2014-12-02T14:36:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-04-19T10:01:26.000Z (about 1 month ago)
- Last Synced: 2025-04-19T15:59:51.974Z (about 1 month ago)
- Topics: hacktoberfest, javascript, personal-identity-number, personnummer, social-security-number, validation
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/personnummer
- Size: 4.09 MB
- Stars: 54
- Watchers: 4
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sweden - JavaScript
README
# personnummer [](https://github.com/personnummer/js/actions) [](https://www.npmjs.com/package/personnummer)
Validate Swedish personal identity numbers.
Install the module with npm:
```
npm install --save personnummer
```## Example
```javascript
import Personnummer from 'personnummer';Personnummer.valid('191212121212')
//=> true
```See [index.test.ts](src/index.test.ts) for more examples.
## Options
| Option | Type | Default | Description |
|-------------------------|:-------------------------|:------------------------|:----------------------------------|
| allowCoordinationNumber | bool | true | Accept coordination numbers |
| allowInterimNumber | bool | false | Accept interim/T numbers |## License
MIT