Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/etienne-dldc/paged-file
- Owner: etienne-dldc
- Created: 2021-11-14T21:55:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-24T14:27:30.000Z (about 3 years ago)
- Last Synced: 2024-10-29T01:05:32.802Z (2 months ago)
- Language: TypeScript
- Size: 164 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
```