npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bitfinex/bfx-facs-db-better-sqlite

v2.1.0

Published

Bitfinex DB Sqlite3 Facility

Readme

bfx-facs-db-better-sqlite

Config

Available the following config options:

{
  name,
  label,
  dbPathAbsolute,
  isSqliteStoredInMemory = false,
  workerPathAbsolute,
  isNotWorkerSpawned = false,
  minWorkersCount = 4,
  maxWorkersCount = 16,
  unacceptableWalFileSize = 100000000,
  readonly = false,
  fileMustExist = false,
  timeout = 5000,
  verbose = false
}
  • name: <string> used to construct the database name: `db-sqlite${name}${label}.db`

  • label: <string> used to construct the database name: `db-sqlite${name}${label}.db`

  • dbPathAbsolute: <string> absolute path to specify a folder for storing DB files

  • isSqliteStoredInMemory (by default false): <boolean> store DB in memory in-memory database, passing ":memory:" as the first argument into the database options

  • workerPathAbsolute: <string> absolute path to specify a worker file for extending DB async query actions, see base implementation in the ./worker folder and extended implementation in the ./test/extended-worker folder

  • isNotWorkerSpawned (by default false): <boolean> not spawn worker threads for async queries

  • minWorkersCount (by default 4): <integer> count spawned workers are equal CPU cores count but not less than this value. If set 0 one worker will be spawned anyway

  • maxWorkersCount (by default 16): <integer> count spawned workers are equal CPU cores count but not more than this value

  • unacceptableWalFileSize (by default 100000000): <integer> unacceptable WAL file size in bytes, when the WAL file gets more than passed value PRAGMA wal_checkpoint(RESTART) will be executed related to checkpoint starvation

  • readonly (by default false): <boolean> open the database connection in readonly mode passing as the second argument into the database options

  • fileMustExist (by default false): <boolean> if the database does not exist, an Error will be thrown instead of creating a new file. This option does not affect in-memory or readonly database connections, passing as the second argument into the database options

  • timeout (by default 5000): <integer> the number of milliseconds to wait when executing queries on a locked database, before throwing a SQLITE_BUSY error passing as the second argument into the database options

  • verbose (by default false): <boolean> if true the console.log will called with every SQL string executed by the database connection, passing console.log as the second argument into the database options

API

Sqlite class provides the following methods:

  • .asyncQuery(args): provides an async way to delegate a query into DB using implemented worker actions or extended worker actions. For that uses Node.js worker threads

    Parameters:

    • args: <Object>
      • action (required): <string> action that needs to pick to process logic
      • sql: <string | Array[string]> SQL that needs to execute by the DB driver via worker
      • params: <any> parameters that pass into worker action

    Returns:

    • <Promise> contains returning action result
  • .initializeWalCheckpointRestart(ms): checks WAL file size in bytes which setting in unacceptableWalFileSize config option, by set interval, when the WAL file gets more than passed value PRAGMA wal_checkpoint(RESTART) will be executed related to checkpoint starvation

    Parameters:

    • ms (by default 10000): <integer> interval in milliseconds with which the WAL file size will be checked