json-fs-query
    Preparing search index...

    Function configure

    • Set where this package's data lives: databasePath (a filesystem path, used in Node) and/or relativePath (a URL prefix prepended to databasePath, used when reading over fetch() in a browser). Call this once before using create()/drop()/query() - a fresh consumer has no other way to point this package at their own data directory.

      enforceForeignKeys (default true) controls whether deleteEntity/updateEntity block an operation that would leave another record's foreign key pointing at a value that no longer exists - mirroring MySQL's own foreign_key_checks setting, which is also toggleable rather than always on, since strict enforcement isn't always what every consumer wants.

      readConcurrency (default 16) is how many entry files a read has in flight at once (see retrieveFiles): in a browser, how many requests run together.

      format (default 'compact') is how files are written: 'compact' (no whitespace: smaller files that parse faster) or 'pretty' (indented by 2 spaces, for reading data in diffs). Either is read; formatDatabase rewrites a whole database in one.

      packedReads (default: true in a browser, false in Node) is whether reads use a record's packed file (see packDatabase) when it has one that matches the record, instead of reading each entry file.

      fetchOptions (default none) is passed to every fetch() a browser read makes, as fetch's second argument: for example { cache: 'no-cache' }, so a page whose data a local server writes always checks for a newer file instead of reading one from the browser's cache. Not used in Node.

      Changing databasePath while calls are still running or queued throws (see trackDatabaseCall): await them first.

      Parameters

      Returns void

      When databasePath would point to another folder while database calls are in progress.

      When format is neither 'compact' nor 'pretty'.