# national-code

> Simple library to validate Iranian national code.

Latest version **0.2.0** (published 2018-02-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install national-code
pnpm add national-code
yarn add national-code
bun add national-code
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-02-14 |
| First published | 2018-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 317.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | @arashmanteghi |
| Maintainers | arashmanteghi |
| Keywords | javascript, library, national, code, validation |

## Links

- npm: https://www.npmjs.com/package/national-code
- Repository: https://github.com/arashmanteghi/national-code
- Homepage: https://github.com/arashmanteghi/national-code#readme
- Issues: https://github.com/arashmanteghi/national-code/issues
- npm.io page: https://npm.io/package/national-code

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2018-02-14
- 0.1.2 — 2018-02-11
- 0.0.2 — 2018-02-11
- 0.0.1 — 2018-02-11

## README

# National Code

Simple library to validate Iranian national code.



## Install

Install with [npm](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/):

npm:
```sh
npm install national-code --save
```


Yarn (note that `yarn add` automatically saves the package to the `dependencies` in `package.json`):
```sh
yarn add national-code
```



## Usage

```js
import nationalCode from 'natioanl-code';
nationalCode(4839941637); // => true
nationalCode(4839941638); // => false
nationalCode('4839941637'); // => true
nationalCode('4839941638'); // => false
nationalCode('2222222222'); // => false
nationalCode(3333333333); // => false
```

or:


```js
var nationalCode = require('national-code');
nationalCode('4839941637'); // => true
```



## Lunch demo as indepented project

1. `git clone https://github.com/arashmanteghi/national-code.git`
2. Run `npm install`
3. Start the http-server using `npm start`
3. Open [http://localhost:9000](http://localhost:9000)



## Commands

- `npm start` - start the http-server
- `npm run build` - build as production
- `npm run lint` - run an ESLint check
- `npm run coverage` - run code coverage and generate report in the `coverage` folder
- `npm test` - run all tests
- `npm run test:watch` - run all tests in watch mode



## Licence
_national-code_ is available under MIT.

---
_Source: https://npm.io/package/national-code · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
