https://github.com/richdouglasevans/issn
ISSN Validation
https://github.com/richdouglasevans/issn
issn js
Last synced: 4 days ago
JSON representation
ISSN Validation
- Host: GitHub
- URL: https://github.com/richdouglasevans/issn
- Owner: richdouglasevans
- License: apache-2.0
- Created: 2015-08-01T10:59:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-27T12:00:52.000Z (over 2 years ago)
- Last Synced: 2025-04-23T19:13:41.013Z (4 days ago)
- Topics: issn, js
- Language: JavaScript
- Homepage:
- Size: 47.9 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
[International Standard Serial Number (ISSN)](http://www.issn.org/understanding-the-issn/what-is-an-issn/) Validation
[](https://nodei.co/npm/issn/)
```bash
npm install issn
``````js
const issn = require("issn");
```Validate ISSNs.
```js
issn("0355-4325"); // true
issn("0xDEDBEEF"); // false
```Format ISSNs.
```js
issn.format("0355-4325"); // '0355-4325'
issn.format("0001253x"); // '0001-253X'issn.format("0xDEDBEEF"); // undefined
```Calculate the check-digit.
```js
issn.calculateCheckDigit("0355432"); // '5'
issn.calculateCheckDigit("0001253"); // 'X'
```## CLI
```bash
$ issn
```Here's another example piping some canned output through [jq](https://stedolan.github.io/jq/).
```bash
$ echo {\"prism:pissn\": \"0000-0019\"} | jq -r '.["prism:pissn"]' | issn
true
```