highlights-email-to-json

1.1.3 • Public • Published

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

Installation

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.

API

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

Example

const toJSON = require("highlights-email-to-json");
const email = readFile(emailPath);

toJSON(email).then((data) => {
	console.log(data);
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.3
    3
    • latest

Version History

Package Sidebar

Install

npm i highlights-email-to-json

Weekly Downloads

10

Version

1.1.3

License

MIT

Unpacked Size

2.95 kB

Total Files

3

Last publish

Collaborators

  • sawyerh