node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »


Convert an email export of notes into a JSON object. This is handy for saving notes from Instapaper or directly from the web.


npm install highlights-email-to-json --save

Expected email format

The email you send must match the following format in order to be converted by this package.

title: Book Title
authors: Author Name; Another author name
Note one text.

Note two text.

Note: The front-matter section at the top will accept any attribute.


toJSON(email) ⇒ Promise.<Object>

Convert a notes email export into a JSON object. Rejects if the mail isn't a valid notes export.

Param Type
email Buffer | Stream | String


const toJSON = require("highlights-email-to-json");
const email = readFile(emailPath);
toJSON(email).then(data => {