stores
    Preparing search index...

    Class FsDatastore

    A datastore backed by the file system.

    Keys need to be sanitized before use, as they are written to the file system as is.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    path: string

    Methods

    • Calculate the directory and file name for a given key.

      Parameters

      Returns { dir: string; file: string }

    • This will return an object with which you can chain multiple operations together, with them only being executed on calling commit.

      Returns Batch

      const b = store.batch()

      for (let i = 0; i < 100; i++) {
      b.put(new Key(`hello${i}`), new TextEncoder('utf8').encode(`hello world ${i}`))
      }

      await b.commit()
      console.log('put 100 values')