npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ahv13-validator

v2.0.1

Published

Validates the AHV 13 Number (swiss social security number)

Downloads

911

Readme

js-ahv13

npm version ci release

About

Helps you to check ahv13 numbers (swiss social security numbers) for their validity. See also this article (in german) for more information about the form.

Installation

To install using npm:

npm install --save ahv13-validator

If you are using yarn:

yarn add ahv13-validator

Usage

The SSN can be passed with or without dots.

import { AHV13 } from 'ahv13-validator';

const ahv13validator = new AHV13();
const isValid = ahv13validator.isValid('756.9217.0769.85');

console.log('valid', isValid)

console.log('5==',ahv13.checkSum('756.9217.0769.8'));
console.log('true==',ahv13.isValid('756.9217.0769.85'));

Contributing

If you want to improve one of these images, your will need the following software installed on your system:

  • node (10 or higher) with npm

You can then install the dependencies by running npm ci.

Test the code

Code can be tested using Jest by running npm run test.

You can use npm run watch:test to watch for files and run the test on every change.

Build

Project can be transpiled from TypeScript to JavaScript by running npm run build.

You can use npm run watch:build to watch for files and build on every change.

Build the documentation

Documentation can be build with TypeDoc by running npm run doc.

You can use npm run watch:doc to watch for files and build the documentation on every change.

Note: This mode will only detect changes to files watched by the TypeScript compiler. Changes to other files (README.md) will not cause a rebuild.

Publish the documenation

Documentation can be published on GitHub Pages by running npm run doc && npm run doc:publish.

Testing GitHub Actions locally

GitHub Actions pipeline can be run locally using act.

Once installed just run act to run the pipeline locally.

External links

Here are a few extra links documenting how swiss social security number are checked:

KUDOS

Made with contrib.rocks.