
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
better-sqlite3-plus
Advanced tools
A collection of functions that can be easily applied to better-sqlite3 database instances
This module is a collection of functions that can be added to your sqlite3 database instance. The aim is to provide common database functionality that will speed up development of features commonly found a database.
Generates a hash value based on the provided string input
import Database from 'better-sqlite3';
import bs3plus from 'better-sqlite3-plus';
const db = new Database('test.db');
bs3plus.crypto(db);
// using all three parameters
const { hash } = db
.prepare(`select genHash(?, ?, ?) as hash`)
.get('string to hash', 'sha256', 'hex');
// using two parameters with default output of hex
const { hash } = db.prepare(`select genHash(?, ?) as hash`).get('string to hash', 'sha256');
// using one parameter with default output of hex hashed with sha256
const { hash } = db.prepare(`select genHash(?) as hash`).get('string to hash');
Generates a password hash value based on the provided inputs
import Database from 'better-sqlite3';
import bs3plus from 'better-sqlite3-plus';
const db = new Database('test.db');
bs3plus.crypto(db);
// using all parameters to create a password hash
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?, ?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 500, 32, 'sha512', 'hex');
// using all but one parameter to create a password hash using hex output
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 500, 32, 'sha512');
// using all but two parameters to create a password hash using hex output and sha512 to generate
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 500, 32);
// using three parameters to create a password hash using hex output and sha512 to generate, with a
// key length of 32 bytes
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 500);
// using three parameters to create a password hash using hex output and sha512 to generate, with a
// key length of 32 bytes and 500 iterations to make the generated hash harder to brute force
const { hash } = db
.prepare(`select genPasswordHash(?, ?) as hash`)
.get('password1!', 'randomSaltValue');
Generates a salt value based on the provided inputs
import Database from 'better-sqlite3';
import bs3plus from 'better-sqlite3-plus';
const db = new Database('test.db');
bs3plus.crypto(db);
// using all parameters to create a salt value with the given parameters
const { salt } = db.prepare(`select genSalt(?, ?) as salt`).get(32, 'hex');
// using one parameter to generate a salt value with hex outpu
const { salt } = db.prepare(`select genSalt(?) as salt`).get(32);
// using the default parameters of 32 bytes and hex to generate a random salt value
const { salt } = db.prepare(`select genSalt() as salt`).get();
FAQs
A collection of functions that can be easily applied to better-sqlite3 database instances
The npm package better-sqlite3-plus receives a total of 0 weekly downloads. As such, better-sqlite3-plus popularity was classified as not popular.
We found that better-sqlite3-plus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.