gkeep-parser
v0.2.0
Published
Convert Google Keep Takeout exports (HTML) into structured JSON data.
Maintainers
Readme
gkeep-parser
Parse Google Keep Takeout exports (HTML / ._keep) into structured JSON.
A lightweight Node.js library and CLI tool that turns the messy HTML files from a Google Takeout export into clean, structured JSON — ready for import into Apple Notes, Evernote, Obsidian, or any other note-taking tool.
Installation
# Install globally for CLI
npm install -g gkeep-parser
# Install as a project dependency
npm install gkeep-parserUsage
CLI
- Download your data from Google Takeout (Select "Keep" only).
- Extract the ZIP file.
- Run the parser on the folder:
# Parse a single HTML file
gkeep-parser to-json "My Note.html"
# Parse an entire Keep Takeout folder
gkeep-parser to-json ./Takeout/Keep -o notes.jsonAPI
import { parseKeepHtml } from 'gkeep-parser';
import fs from 'fs';
const html = fs.readFileSync('My Note.html', 'utf-8');
const note = parseKeepHtml(html);
console.log(note.title);
console.log(note.tags); // ['Personal', 'Ideas']
console.log(note.created); // ISO 8601 string, or undefined if not found
console.log(note.attachments); // [{ filePath: '...', mimeType: '...' }]Handling Missing Dates
Because created / updated can be undefined, always apply a fallback in your own code:
const note = parseKeepHtml(html);
const fileDate = new Date(file.lastModified).toISOString();
note.created = note.created ?? fileDate;
note.updated = note.updated ?? fileDate;Output Format
interface KeepNote {
title: string;
content: string; // HTML content
textContent: string; // Plain text
tags: string[];
created?: string; // ISO 8601, undefined when not parseable
updated?: string; // ISO 8601, undefined when not parseable
isArchived: boolean;
isPinned: boolean;
isTrashed: boolean;
attachments: { filePath: string; mimeType: string; }[];
}License
MIT
{ github.com/mgks }
![]()
