Registry / database / sqlite-lines

sqlite-lines

JSON →
library0.2.2jsnpmunverified

A SQLite extension for line-by-line file processing within SQL queries, distributed as an npm package for Node.js. Version 0.2.2 provides pre-compiled binaries for darwin-x64, win32-x64, and linux-x64. The extension allows reading, splitting, and generating lines from files or text directly in SQL, with functions like lines_read(), lines_split(), and lines_version(). Use with better-sqlite3 or node-sqlite3 via db.loadExtension(getLoadablePath()). No prebuilt binaries for ARM or musl Linux.

npm install sqlite-lines
INSTALL
IMPORT
SIG · SQLITE-LINES
S
sqlite-lines
databasejavascriptv0.2.2
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.

getLoadablePath
import * as sqlite_lines from 'sqlite-lines'; const path = sqlite_lines.getLoadablePath();
const { getLoadablePath } = require('sqlite-lines');
Package exports only getLoadablePath via named export; default export is not available.
lines_version()
db.loadExtension(require('sqlite-lines').getLoadablePath()); db.prepare("SELECT lines_version()").pluck().get();
SQL function available only after loading extension. Not exported from npm package itself.
require('sqlite-lines')
const sqlite_lines = require('sqlite-lines');
const sqlite_lines = require('sqlite-lines').default;
CommonJS import works; the package exports the getLoadablePath function directly, no default export.

Shows how to load the sqlite-lines extension into better-sqlite3, check the version, and read lines from a file.

import Database from 'better-sqlite3'; import * as sqlite_lines from 'sqlite-lines'; const db = new Database(':memory:'); db.loadExtension(sqlite_lines.getLoadablePath()); const version = db.prepare('SELECT lines_version()').pluck().get(); console.log('lines_version:', version); // read lines from a file const lines = db.prepare('SELECT * FROM lines_read(?)').all('/path/to/file.txt'); console.log(lines);
Debug
Known issues
breakingPre-compiled binaries only for darwin-x64, win32-x64, linux-x64
fix
Use on one of those platforms or may fail to load extension with unsupported platform error.
affects: >=0.0.0
gotchagetLoadablePath() returns an absolute path; must be called after package installation, and the correct optional dependency must be installed automatically
fix
Ensure npm install downloads the correct platform-specific package (e.g., sqlite-lines-darwin-x64).
affects: >=0.0.0
gotchaExtension functions (lines_read, lines_split, etc.) are only available after loading the extension into a database connection; not exposed directly via JS
fix
Use db.loadExtension() before running any sqlite-lines SQL functions.
affects: >=0.0.0
deprecatedThe package may be renamed or moved; current version 0.2.x API subject to change
fix
Check migration notes when upgrading to v1.x.
affects: <=0.2.2
Errors
Common errors & fixes
Error: dlopen(libsqlite-lines.so): image not found
Missing or incorrect platform-specific binary; binary not found for current OS/arch
fix
Verify platform support; if on unsupported platform (e.g., ARM Mac), use a different approach or container.
Error: Cannot find module 'sqlite-lines'
Package not installed or optional dependencies failed to download
fix
Run npm install sqlite-lines again, or check npm registry and network connectivity.
Error: The specified module could not be found
On Windows, binary not found or dependencies missing (e.g., Visual C++ Redistributable)
fix
Install Visual C++ Redistributable for Visual Studio 2015-2022.
Upgrade
Version history
0.2.2latest on npm
Audit
Dependencies
better-sqlite3optionalCommon SQLite client used to load extension
sqlite3optionalAlternative SQLite client used to load extension
Agent activity
13 hits · last 30 days
node
10
Meta
2
OpenAI (training)
1
Resources
sqlite-lines — npm install sqlite-lines · libregistry