Skip to content

Instantly share code, notes, and snippets.

@brianschmitt
Created May 1, 2026 00:31
Show Gist options
  • Select an option

  • Save brianschmitt/42eb80270642bdb94d31ec0145789ade to your computer and use it in GitHub Desktop.

Select an option

Save brianschmitt/42eb80270642bdb94d31ec0145789ade to your computer and use it in GitHub Desktop.
Export Todoist as json
var dbName = 'todoist.sync';
var storeName = 'tasks';
var request = indexedDB.open(dbName);
request.onsuccess = function(event) {
var db = event.target.result;
var transaction = db.transaction([storeName], "readonly");
var objectStore = transaction.objectStore(storeName);
var allItemsRequest = objectStore.getAll();
allItemsRequest.onsuccess = function() {
var all_items = allItemsRequest.result;
console.log(all_items); // Optional: view the items in the console
copy(JSON.stringify(all_items)); // Copies the data as a JSON string to your clipboard
console.log("All items copied to clipboard!");
};
allItemsRequest.onerror = function(event) {
console.error("Error retrieving all items:", event.target.errorCode);
};
};
request.onerror = function(event) {
console.error("Error opening database:", event.target.errorCode);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment