
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
โจ A simple key-value JSON-based lightweight database. โจ
Jsoning is a simplified wrapper for Node.js that lets you write and read data to and from JSON files. It's designed to be beginner-friendly and easy to use, with a simple API that makes it easy to get started with. It's perfect for small projects, prototyping, and learning how to work with databases.
Node.js v16.x or greater is required for this package to work.
npm i jsoning
# pnpm if you're feeling fast
pnpm i jsoning
# yarn if you're feeling fancy
yarn add jsoning
View the full documentation here.
import { Jsoning, MathOps } from 'jsoning';
const db = new Jsoning('database.json');
// Set some values with a key
await db.set('birthday', '07-aug');
await db.set('age', '13');
// Push stuff to an array for a particular key
await db.push('transformers', 'optimus prime');
await db.push('transformers', 'bumblebee');
await db.push('transformers', 'iron hide');
// Get the value of a key
console.log(await db.get('transformers')); // [ 'optimus prime', 'bumblebee', 'iron hide' ]
// Get all the values
console.log(await db.all()); // { Record<string, JSONValue> of the whole database contents }
// does such a value exist?
console.log(await db.has('value2')); // false
// My age keeps changing, so I'm deleting it
console.log(await db.delete('age')); // true
// I got $100 for my birthday
await db.set('money', 100);
// and someone gave me $200 more
await db.math('money', MathOps.Add, 200);
// Just wanna make sure how much money I got
console.log(await db.get<number>('money')); // 300
// RIP iron hide, he died
await db.remove('transformers', 'iron hide');
// I'm getting bored, so I'm clearing the whole database
await db.clear();
Please see CONTRIBUTING.md
for more details on contributing!
Thanks goes to these wonderful people (emoji key):
Khaleel Gibran ๐ป ๐ ๐จ ๐ โ ๏ธ โ | David ๐ | Jonyk56 ๐ป | ayntee ๐ป | undefine ๐ป ๐ ๐ก๏ธ | Aditya Gupta ๐ป | Manuel Maly ๐ป ๐ |
wh0 ๐ป | akpi816218 ๐ป ๐ ๐ก ๐ง โ ๏ธ ๐ง |
This project follows the all-contributors specification. Contributions of any kind are welcome!
This package is open sourced under the MIT License.
FAQs
A simple key-value JSON-based persistent lightweight database.
The npm package jsoning receives a total of 2,095 weekly downloads. As such, jsoning popularity was classified as popular.
We found that jsoning demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.