Skip to main content

Validate Swedish personal identity numbers

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
70%
Published
2 months ago (3.2.1)

personnummer Build Status NPM Downloads

Validate Swedish personal identity numbers.

Install the module with npm:

npm install --save personnummer

Example

import Personnummer from 'personnummer';

Personnummer.valid('198507099805')
//=> true

See test.ts for more examples.

License

MIT

Add Package

deno add @personnummer/personnummer

Import symbol

import * as mod from "@personnummer/personnummer";

Add Package

npx jsr add @personnummer/personnummer

Import symbol

import * as mod from "@personnummer/personnummer";

Add Package

yarn dlx jsr add @personnummer/personnummer

Import symbol

import * as mod from "@personnummer/personnummer";

Add Package

pnpm dlx jsr add @personnummer/personnummer

Import symbol

import * as mod from "@personnummer/personnummer";

Add Package

bunx jsr add @personnummer/personnummer

Import symbol

import * as mod from "@personnummer/personnummer";