Skip to content

Simple, no dependencies JSON, table level, Node.js database.

Notifications You must be signed in to change notification settings

jackfiszr/json-db

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Talaikis Ltd.

Local JSON Database

This is simple, fast, small (12.5 KB), no dependencies, local disk, table-level Node.js JSON database, which we often use in large development workloads.

Install

npm i -S @talaikis/json-db

Fucntions

All functions need baseDir, where the database is stored. For example: join(__dirname, '.data').

Create item in a table

import { create } from '@talaikis/json-db'
await create(baseDir, table, itemName, jsonData).catch((e) => ...)

Read item from the table

import { read } from '@talaikis/json-db'
const jsonData = await read(baseDir, table, itemName).catch((e) => ...)

Update the item in a table

import { update } from '@talaikis/json-db'
await update(baseDir, table, itemName, newJsonData).catch((e) => ...)

Delete item from the table

import { destroy } from '@talaikis/json-db'
await destroy(baseDir, table, itemName).catch((e) => ...)

List table items

import { list } from '@talaikis/json-db'
await list(baseDir, table).catch((e) => ...)

Delete table

import { destroyTable } from '@talaikis/json-db'
await destroyTable(baseDir, table).catch((e) => ...)

Test

npm run test

Licence

MIT

About

Simple, no dependencies JSON, table level, Node.js database.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 93.4%
  • TypeScript 6.6%