Registry /
database / sqlite-hello-darwin-arm64
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.
default (namespace)
✓ import * as sqliteHello from 'sqlite-hello-darwin-arm64'
✗ import sqliteHello from 'sqlite-hello-darwin-arm64'
This package exports a namespace object; default import will not work.
loadExtension
✓ import { loadExtension } from 'sqlite-hello-darwin-arm64'
✗ const { loadExtension } = require('sqlite-hello-darwin-arm64')
CommonJS require is not supported; this package is ESM-only.
Type definitions
✓ import type { HelloExtension } from 'sqlite-hello-darwin-arm64'
✗ import { HelloExtension } from 'sqlite-hello-darwin-arm64'
HelloExtension is a type, not a runtime value. Use import type.
Shows how to load the extension from Node.js using better-sqlite3 and invoke the hello function.
import * as sqliteHello from 'sqlite-hello-darwin-arm64';
import Database from 'better-sqlite3';
const db = new Database(':memory:');
// Load the extension using its path
const extPath = sqliteHello.path;
db.loadExtension(extPath);
// Call the 'hello' function
const result = db.prepare("SELECT hello('World')").pluck().get();
console.log(result); // 'Hello, World!'
db.close();
Debug
Known issues
gotchaPlatform-specific package: only works on darwin-arm64 (macOS with Apple Silicon). Attempting to install on other platforms will result in missing binary.fixUse a conditional dependency or rely on sqlite-dist to automatically select the correct platform package.
affects: all
breakingESM-only: This package does not support CommonJS require. Using require() will throw.fixUse import syntax or enable ESM in your project.
affects: >=0.1.0-alpha.79
deprecatedThe extension name may change in future releases; sqlite-hello is a test extension and not stable.fixDo not rely on this package in production; use only for testing sqlite-dist.
affects: all
Errors
Common errors & fixes
Cannot find module 'sqlite-hello-darwin-arm64' or its corresponding type declarations.
Package not installed or unsupported platform (not darwin-arm64).
fixRun `npm install sqlite-hello-darwin-arm64` on a macOS Apple Silicon machine, or use sqlite-dist for cross-platform.
Error: The module 'sqlite-hello-darwin-arm64' is not a valid ESM module.
Trying to use CommonJS require() on an ESM-only package.
fixChange the import to an ESM import: `import * as sqliteHello from 'sqlite-hello-darwin-arm64'`
TypeError: db.loadExtension is not a function
Using a database driver that does not support loadExtension (e.g., sql.js instead of better-sqlite3).
fixUse better-sqlite3 or another driver that supports loading native extensions.
Upgrade
Version history
0.1.0-alpha.79latest on npm
Audit
Dependencies
No dependency data recorded yet.