Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/etienne-dldc/paged-file

Store data on file using pages
https://github.com/etienne-dldc/paged-file

Last synced: 19 days ago
JSON representation

Store data on file using pages

Awesome Lists containing this project

README

        

# Paged file

> Deno lib to store data on a file using pages

## Usage

```ts
export { PagedFile } from "https://deno.land/x/paged_file/mod.ts";

const file = new PagedFile("file.db");

const rootContent = file.readRootPage(); // Uint8Array

const pageAddr = file.createPage(); // number (page address)

const someData = new Uint8Array();

file.writePage(pageAddr, someData);

// persist changes to the disk
file.save();

const pageData = file.readPage(pageAddr);
```