New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

db-fn

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-fn

## Case 1

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

FileSystem DataBase

Case 1

One label define single database

const LABEL = 'foo'
const {id} = await push({a:1},LABEL)
await push({a:20},LABEL)
const allState = loadJson(LABEL)
const singleInstance = load(id)

Case 2

Two labels define child as a file logic

const LABEL = 'foo'
await save({translated:'more'},LABEL, 'mehr')
await save({translate: 'less'},LABEL, 'wenig')
const allState = loadAll(LABEL)
const singleInstance = load(LABEL, 'mehr')
const updatedInstance = await update({
  ...singleInstance,
  existingProp: 2,
  newProp: 6
})

API

save method for direct json modification update for data stored with push

FAQs

Package last updated on 24 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts