@wholebuzz/archive

Archive database using sorted chains of JSON array blocks. Each block is represented as a file (with random filename) on Cloud Storage and structured as an ArchiveBlock JSON object. Uses @wholebuzz/fs for atomic appends to Cloud Storage.

Usage no npm install needed!

<script type="module">
  import wholebuzzArchive from 'https://cdn.skypack.dev/@wholebuzz/archive';
</script>

README

@wholebuzz/archive

Archive database using sorted chains of JSON array blocks. Each block is represented as a file (with random filename) on Cloud Storage and structured as an ArchiveBlock JSON object. Uses @wholebuzz/fs for atomic appends to Cloud Storage.

Example

const archive = new ArchiveDatabaseServer<Event>(
  'news',
  [
    {
      name: 'publisher',
      getter: getEventPublishers,
      sorter: compareEventReverse,
      blockDatabase: new FileStorageArchiveBlockDatabase<Event>(
        fileSystem,
        'gs://archive',
        parseEventJSON
      ),
      tipDatabase: new FileStorageArchiveTipDatabase(
        fileSystem,
        'gs://archive-index',
        sha1),
    },
  ])

await archive.addItems(item);
const tipBlock = await archive.getTipBlock(archive.indices[0], publisher)

Table of contents

Classes

Interfaces

Variables

Variables

sorted

Const sorted: any

Defined in: node_modules/@wholebuzz/archive-base/lib/index.d.ts:1