@wholebuzz/archive
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @wholebuzz/archive

Weekly Downloads

0

Version

0.0.2

License

Apache-2.0

Unpacked Size

98.6 kB

Total Files

10

Last publish

Collaborators

  • wholenewsorg