New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

book2json

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

book2json

HTML Importer from Gutenberg to JSON

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Book2JSON

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.

Install

npm install --save book2json

Usage


var book2json = require('book2json');

// load a file in Gutenberg html format
fs.readFile(bookPath, function(err, content) { 
  // translate into JSON
  book2json.importGutenbergHtml(content)
    .then(function(json){
      // do something with your JSON data    
    });
});

Tests

This module includes some Mocha/Chai tests which can be run with:

npm test

Keywords

gutenberg

FAQs

Package last updated on 22 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts