
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.
A number of functions will be added to your sqlite3 instance. Those functions are as follows:
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);
const { hash } = db
.prepare(`select genHash(?, ?, ?) as hash`)
.get('string to hash', 'sha256', 'hex');
const { hash } = db.prepare(`select genHash(?, ?) as hash`).get('string to hash', '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);
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?, ?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 32, 500, 'sha512', 'hex');
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 32, 500, 'sha512');
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 32, 500);
const { hash } = db
.prepare(`select genPasswordHash(?, ?, ?) as hash`)
.get('password1!', 'randomSaltValue', 32);
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);
const { salt } = db.prepare(`select genSalt(?, ?) as salt`).get(32, 'hex');
const { salt } = db.prepare(`select genSalt(?) as salt`).get(32);
const { salt } = db.prepare(`select genSalt() as salt`).get();
When adding the crypto functions module to your sqlite3 instance, a number of statements and statement generators are also returned for you to use at your convenience.
This function receives as input an options object and returns a sqlite3 statment based on the provided options. The options are:
import Database from 'better-sqlite3';
import bs3plus from 'better-sqlite3-plus';
const db = new Database('test.db');
const cryptoHelpers = bs3plus.crypto(db);
const myPasswordHashingStatement = cryptoHelpers.createSaltAndPasswordHash({
algorithm: 'sha512',
encoding: 'hex',
iterations: 500,
keyLength: 16
});
const result = myPasswordHashingStatement.get({ password: 'myPassword1!' });
console.log(result);
// PRINTS
// {
// salt: '4ecc819ec883c5df7eac7615f80e0d23',
// hash: '23c55169ff62921a018fbbd8616621d9'
// }
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 1 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.