JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q54710F
  • License MIT

Package Exports

  • isbn-util

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (isbn-util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status Coverage Status

ISBN Util

Breaking change from version 2.0.0. From this version this module should be used as esm module. If you prefer use as CommonJS Module, install previous v1.1.2

This module check if an ISBN is valid or not and also provide a method to generate a valid random ISBN-10 or ISBN-13

Install

npm i isbn-util --save-dev

Usage

import { validate, generate } from 'isbn-util';

validate('84-481-2231-3');
//=> true

validate('0137081073');
//=> true

validate('isbn: 84-481-2231-3');
//=> false

generate('13');
//=> '9780137081073'

generate('13', 'prefix');
//=> 'isbn-13: 9780137081073'

generate('10');
//=> '8448122313'