🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

json-simplified

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-simplified

Basic json database.

1.4.0
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

json-simplified

Simple JSON Database

Created By: OneAndonlyFinbar
Discord: Finbar#0001
Email: finbar@finbar.xyz
Documentation: https://jsonsimplified.finbar.xyz/

Quick Start

const { Database } = require('json-simplified');
const db = new Database('versionsDatabase');
db.set('version', '1.0');
db.get('version') // 1.0

Simple Usage

const db = new Database('DatabaseName', {DatabaseOptions});
db.set('Field/Path', 'Data');
db.get('Field/Path'); // Data

// Using Field Names
db.set('latestVersion', '1');
db.get('latestVersion'); // 1

// Using JSON Paths
db.set('versions.latest', '1');
db.get('versions.latest'); // 1

// Delete data using field name
db.delete('latestVersion');

// Delete Data Using JSON Path
db.delete('versions.latest');

// Destroy database
db.destroy();

Setting Multiple Values

db.set('Finbar', {name: 'Finbar', gender: 'male', occupation: 'freelance programmer'});
db.get('users', 'Finbar'); // {name: 'Finbar', gender: 'male', occupation: 'freelance programmer'}

Set And Get From JSON Path

db.set('Finbar.name', 'Finbar');
db.set('Finbar.gender', 'Male');
db.set('Finbar.occupation', 'freelance programmer');
db.get('Finbar'); // {name: 'Finbar', gender: 'male', occupation: 'freelance programmer'}
db.get('users', 'Finbar.name'); // Finbar

Database Options

OptionTypeDescription
overwriteOldbooleanCreate a new database file, whether or not one exists.
registrystringRegistry/directory for the database files to be placed in.

Keywords

JSON

FAQs

Package last updated on 29 Dec 2021

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