Canadian Health Insurance Number Validator provides validation utilities for canadian health insurance data inputs. It is designed as a CommonJS module for use in Node.js, or the browser.
You can install hin-validator
through npm
.
npm install hin-validator
import { isValidHealthInsuranceNumber } from "hin-validator";
const isValid = isValidHealthInsuranceNumber("00000-0000", "AB");
console.log(isValid); // true
Province codes:
Alberta: AB
BritishColumbia: BC
Manitoba: MB
NewBrunswick: NB
NewfoundlandandLabrador: NL
NorthwestTerritories: NT
NovaScotia: NS
Nunavut: NU
Ontario: ON
PrinceEdwardIsland: PE
Quebec: QC
Saskatchewan: SK
Yukon: YT