Giter Site home page Giter Site logo

isbnjs's Introduction

isbnjs's People

Contributors

bcherny avatar makepanic avatar tadas-s avatar taitems avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

isbnjs's Issues

accept numeric ISBNs

the following should be acceptable:

// isbn passed as Number rather than String
ISBN.parse(9784873113685)

Dosen't accept Certain valid isbn13

Hi,

The validator can't parse certain Isbn13 such one i copied from amazon books detail
Here's an example:

var isbn13a = ISBN.parse('978-2212136029');
isbn13a.isIsbn13();  

console return TypeError: Cannot call method 'isIsbn13' of null

Does not work in mostly cases

Its a bit weird, but mostly its not working for me.

Example in my app:

var ISBN = require('isbnjs');
ISBN.parse('9781590597279'); // works fine. ISBN from your example
ISBN.parse('9783125881204'); // null -> but this is a valid ISBN. on your demo page http://coolaj86.github.io/isbnjs/ its working ...

Am I missing something ? Using isbnjs 0.2.2 but also tested with isbn 0.4.0

Does not correctly validate ISBNs

9783428091478
9783428119493
9789077596197
9789089744760
9789024715251
9789024704309
9789490947996
9789490947897
9789462360617
9783631577929

ReferenceError: window is not defined

ReferenceError: window is not defined
    at /opt/data-importer/node_modules/isbn/isbn.js:227:17
    at Object.<anonymous> (/opt/data-importer/node_modules/isbn/isbn.js:229:2)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/opt/data-importer/libs/rawBooks.js:6:14)
    at Module._compile (module.js:434:26)

I get this error in node 4.1

IFFE is not correct standard for universal modules

There is an issue with the way this module is exported. I understand that you want the module to support both browser and node usages. But when the module is imported into a babel node environment the ISBN export is an empty object e.g. the module fails and is unusable. (It is fine in a node env that is does not use babel). The problem is with the IFFE that the main export is wrapped in. If I remove the IFFE and expose the module.exports in the module scope babel can correctly read the module. Making this module universal would be better achieved using a UMD build pattern. Using the following babel:

"babel-cli": "^6.26.0",
"babel-core": "^6.17.0",
"babel-preset-env": "^1.6.1",

Fails when used in node.js

Running "mochaTest:src" (mochaTest) task

Mocha exploded!
ReferenceError: window is not defined
at C:\Users\wcma\workspace.luna\mappingservice\mappingservice\node_module
s\isbn\isbn.js:227:17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.