
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.
database-js-json
Advanced tools
A database-js driver for JSON files.
This is a wrapper around the jl-sql-api, intended to be used with database-js for handling JSON files.
Our releases adopt Semantic Versioning.
npm install database-js-json
var Connection = require( 'database-js2' ).Connection;
(async () => {
const connection = new Database( 'json:///test.json' );
try {
let statement = await connection.prepareStatement("SELECT * WHERE user_name = ?");
let rows = await statement.query('not_so_secret_user');
console.log(rows);
} catch (error) {
console.log(error);
} finally {
await connection.close();
}
} )();
Options can be passed as arguments to the database connection string, in URL-format.
charset
: defines the charset (encoding) used to handle the JSON file
utf-8
const connection = new Database( 'json:///test.json?charset=utf-16' );
1.0.0
or latercheckOnConnect
: whether it should check if the file exists when connecting to it
true
const connection = new Database( 'json:///test.json?checkOnConnect=false' );
false
, no
or 0
as false1.1.0
or laterOptions from jl-sql-api can also be passed as arguments to the database connection.
Example: { tmpDir: "/path/to/dir" }
const connection = new Database( 'json:///test.json?tmpDir=path/to/dir' );
When an option that belongs to a group is informed, it must have a dot.
Example: { tmpDir: "/path/to/dir", sortOptions: { inMemoryBufferSize: 32000 } }
const connection = new Database( 'json:///test.json?tmpDir=path/to/dir&sortOptions.inMemoryBufferSize=32000' );
FAQs
Database-js driver for JSON files
The npm package database-js-json receives a total of 14 weekly downloads. As such, database-js-json popularity was classified as not popular.
We found that database-js-json 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.