Converts books from various html formats such as Gutenberg into a JSON block format. Along the way it also cleans up text artifacts such as straight quotes. Outputs an array of block objects with clean HTML content and some block classes.
npm install --save book2json
varbook2json=require('book2json');// load a file in Gutenberg html formatfs.readFile(bookPath,function(err,content){// translate into JSONbook2json.importGutenbergHtml(content).then(function(json){// do something with your JSON data });});This module includes some Mocha/Chai tests which can be run with:
npm test