Utility functions for Icelandic social security numbers (kennitolur). Written in TypeScript, supports both CommonJS and ES Modules. Current stable version is 6.1.2. Released as needed, with changelog on GitHub. Key differentiator: comprehensive set of functions for formatting, validation, date extraction, and company detection. Includes full TypeScript type definitions.
npm install kennitala-utilityNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use key functions: format, isValid, getAge, clean, and makeKennitala.
Use cleanAndValidate() if you need both cleaning and validation.
Always validate input; the function expects either 10 digits or format 'XXXXXX-XXXX'.
Pass a reference date if you need age at a specific time, e.g., getAge('1201743399', new Date('2024-01-01')).Do not rely on deterministic outputs; the suffix is random.
Upgrade to v6.x and update imports as shown in the docs.
Run 'npm install kennitala-utility' or 'yarn add kennitala-utility' in your project.
Use named import: import { isValid } from 'kennitala-utility'Set 'esModuleInterop': true in tsconfig.json, or use import = require syntax.
Ensure the kennitala is either 10 digits or in the format 'XXXXXX-XXXX'. Use clean() first to remove spaces or dashes.
No dependency data recorded yet.