Skip to content

Instantly share code, notes, and snippets.

View tianalei's full-sized avatar
🎯
Focusing

Tiana tianalei

🎯
Focusing
View GitHub Profile
@tianalei
tianalei / fetchHighlightsFromAppleBooks.js
Created December 1, 2023 04:58 — forked from asci/fetchHighlightsFromAppleBooks.js
Export Highlights from Apple Books
const fs = require("fs");
const sqlite3 = require("sqlite3");
const glob = require("glob");
const os = require("os");
const { open } = require("sqlite");
const username = os.userInfo().username;
const ANNOTATION_DB_PATH = `/users/${username}/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/`;
const BOOK_DB_PATH = `/users/${username}/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrary/`;
const annotationsFiles = glob.sync(`${ANNOTATION_DB_PATH}/*.sqlite`);