coolaj86 / isbnjs Goto Github PK
View Code? Open in Web Editor NEWgit svn clone http://isbnjs.googlecode.com/svn/trunk/
Home Page: https://coolaj86.github.com/isbnjs
git svn clone http://isbnjs.googlecode.com/svn/trunk/
Home Page: https://coolaj86.github.com/isbnjs
the following should be acceptable:
// isbn passed as Number rather than String
ISBN.parse(9784873113685)
Latest version on NPM is not working for node, but fixed on github: 1387503
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
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
9783428091478
9783428119493
9789077596197
9789089744760
9789024715251
9789024704309
9789490947996
9789490947897
9789462360617
9783631577929
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
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",
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.