Skip to content

Instantly share code, notes, and snippets.

View jfrancos's full-sized avatar

Justin Francos jfrancos

View GitHub Profile
@jfrancos
jfrancos / docs-to-indexeddb.ts
Last active January 14, 2022 04:13
Turn an RxDB `bulkInsert` into an exported indexeddb.json file using Node.js
import 'fake-indexeddb/auto';
import { readFile, writeFile } from 'fs/promises';
import { exportToJsonString } from 'indexeddb-export-import';
import { getDatabase } from './Database';
const inFile = 'bulkInsertableData.json';
const outFile = 'indexeddb.json';
const collectionName = 'collection';
const prepIndexedDB = async () => {