Registry / database / webadnan-npm-sqlite

webadnan-npm-sqlite

JSON →
library1.0.7jsnpmunverified

A minimal key-value store built on top of SQLite, version 1.0.7. It exposes a simple async getter/setter API (set, get, size, run) and automatically creates a SQLite database file if one doesn't exist at the given path. This package is a lightweight wrapper around better-sqlite3, intended for small-scale projects where a full ORM is overkill. Last updated with no recent release cadence; likely a personal utility.

npm install webadnan-npm-sqlite
INSTALL
IMPORT
SIG · WEBADNAN-NPM-SQLIT
W
webadnan-npm-sqlite
databasejavascriptv1.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Sqlite
const Sqlite = require('webadnan-npm-sqlite');
import Sqlite from 'webadnan-npm-sqlite';
Package is CommonJS only; ESM import will fail.
Sqlite
const { default: Sqlite } = require('webadnan-npm-sqlite');
const { Sqlite } = require('webadnan-npm-sqlite');
The main export is a class via module.exports, not a named export.
Sqlite
import Sqlite = require('webadnan-npm-sqlite');
import * as Sqlite from 'webadnan-npm-sqlite';
TypeScript namespace import workaround; default import fails.

Demonstrates key-value set/get, size query, and raw SQL execution using async/await.

const Sqlite = require('webadnan-npm-sqlite'); async function main() { const db = new Sqlite(); await db.connect('./test.sqlite'); await db.set('greeting', 'Hello, World!'); const value = await db.get('greeting'); console.log(value); // 'Hello, World!' console.log(await db.size()); // 1 await db.run('DROP TABLE IF EXISTS test'); } main().catch(console.error);
Debug
Known issues
gotchaAll methods are asynchronous but use better-sqlite3 synchronously under the hood. The promises are artificial; errors might be swallowed on connection or query failure.
fix
Use try-catch around every async call and check for null returns.
affects: all
gotchaThe set/get methods only accept string values. Other types (numbers, booleans, objects) are not automatically serialized.
fix
Convert values to strings (e.g., JSON.stringify) before storing and parse on retrieval.
affects: all
gotchaThe package name is webadnan-npm-sqlite; there are many similarly named packages on npm. Ensure you install this exact name.
fix
Check package.json license and author before use.
affects: all
deprecatedNo version bumps since initial release; considered low maintenance. No TypeScript definitions or browser support.
fix
Consider better-sqlite3 directly or a maintained wrapper like sqlite3 or sequelize.
affects: all
Errors
Common errors & fixes
Cannot find module 'better-sqlite3'
Missing native SQLite driver dependency.
fix
Run: npm install better-sqlite3
db.get is not a function
Trying to call get before initializing the db object (missing new keyword).
fix
Use: const db = new Sqlite();
TypeError: db.connect is not a function
The package exports a class, not an object. Direct use of require() exports the class.
fix
Instantiate with new: const db = new Sqlite();
Error: Cannot find module 'webadnan-npm-sqlite'
Package not installed.
fix
Run: npm install webadnan-npm-sqlite
Upgrade
Version history
1.0.7latest on npm
Audit
Dependencies
better-sqlite3requiredsynchronous SQLite3 driver used internally
Agent activity
26 hits · last 30 days
node
22
Meta
1
OpenAI (training)
1
Resources
webadnan-npm-sqlite — npm install webadnan-npm-sqlite · libregistry