1.3.7 • Published 4 months ago

nano-db-fetch v1.3.7

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
4 months ago

📖 NANODbFetch driver

NANODbFetch is a database class built on top of NANODatabase, using IndexedDB for local caching of fetched data. It supports efficient data fetching, filtering, and storage using IndexedDB, allowing seamless offline access and synchronization with remote servers.

📌 Features

  • IndexedDB-based caching
  • Fetch data from a remote source or cache
  • Filter-based data retrieval
  • Manifest-based data storage and retrieval
  • Change tracking and merging
  • Storage usage calculation

🔑 Usage

import { NANODbFetch } from 'nano-db-fetch'
const fetchDb = new NANODbFetch('/', {
	inherit: true,
	extend: true,
	globals: true,
	refs: true,
	root: 'http://localhost'
})
await fetchDb.load()
// Fetching Data
const index = await fetchDb.get('/index')
// Fetching All Nodes including files, dirs, and globals
const nodes = await fetchDb.findAllNodes()
// Saving Data into the indexedDB but acceptable for the db in next retrievals
const newData = { content: ['Empty content'] }
await fetchDb.set('/index', newData)
// Checking Storage Usage
const usage = await fetchDb.getUsage()
1.3.7

4 months ago

1.3.6

4 months ago

1.3.5

4 months ago

1.3.4

4 months ago

1.3.3

4 months ago

1.3.2

4 months ago

1.3.1

4 months ago

1.3.0

4 months ago

1.2.0

4 months ago

1.1.2

4 months ago

1.1.1

4 months ago

1.1.0

4 months ago

1.0.0

5 months ago