@noy-db/to-file
JSON file adapter for noy-db — encrypted document store on local disk, USB sticks, or network drives.
Install
pnpm add @noy-db/hub @noy-db/to-fileUsage
import { createNoydb } from '@noy-db/hub'
import { file } from '@noy-db/to-file'
const db = await createNoydb({
adapter: file({ dir: '/Volumes/USB/firm-data' }),
userId: 'alice',
passphrase: process.env.NOYDB_PASSPHRASE!,
})Each compartment is written as a set of JSON files containing only ciphertext envelopes — the adapter never sees plaintext. Perfect for:
- USB-stick workflows (air-gapped data portability)
- Local-first desktop apps
- Network drive sharing with per-user passphrases
- Backup-friendly storage
License
MIT vLannaAi — see the noy-db repo for full documentation.