JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q34154F
  • License MIT

A database library stores JSON file for Node.js.

Package Exports

  • concisedb
  • concisedb/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (concisedb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

concisedb

A database library stores JSON file for Node.js.

Usage

You can also use other package manager like yarn and pnpm instead

  1. Install this library
npm install concisedb
  1. Example code
const ConciseDb = require('concisedb')
const path = require('path')

const db = new ConciseDb(path.join(__dirname, 'db.json'), { test: [] })

db.data.test.push(1) // It will update JSON file automatically by using Proxy
// So for performance, if you need to change the data many times at once
// you can use db.getData() to get a copy of data

console.log(db.data) // Output: { test: [ 1 ] }
  1. This library also supports TypeScript
import ConciseDb from 'concisedb'
import { join } from 'path'

interface Database {
  test: number[]
}

const db = new ConciseDb<Database>(join(__dirname, 'db.json'), { test: [] })

db.data.test.push(1) // It will update JSON file automatically by using Proxy
// So for performance, if you need to change the data many times at once
// you can use db.getData() to get a copy of data

console.log(db.data) // Output: { test: [ 1 ] }