Set of tools to work with Kindle Vocabulary Builder.
Before using the library, make sure you have access to the vocab.db
file from Kindle. The easiest way is to plug in your Kindle device and find the file at /Volumes/Kindle/system/vocabulary/vocab.db
(default path on MacOS
).
npm install kindle-vocab-tools
import KindleVocabTools from "kindle-vocab-tools";
const db = new KindleVocabTools({
pathToDB: "/Volumes/Kindle/system/vocabulary/vocab.db",
});
await db.init();
const books = await db.getAllBooks();
for (const book of books) {
const lookups = await db.getLookupsByBook(book.id);
console.log(lookups);
}
Initializes connection to vocab.db
database.
Must be called and awaited before using rest of the API's
Returns all the books.
Returns all the lookups.
Returns all the lookups for a specific book.
bookId
could be found as id
prop of Book
type
Deletes book and all the lookups connected with it.
Deletes all words.
Deletes words by bookId
.
Deletes a book.
bookId
could be found as id
prop of Book
type
Deletes all lookups.
Deletes lookup by id
.
Deletes lookups by bookId
.
bookId
could be found as id
prop of Book
type