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

npxbase

v1.0.0

Published

A professional and modular database management library for Node.js with support for MySQL, PostgreSQL, and MongoDB.

Readme

NPXBase

NPXBase is a professional, flexible, and modular database management library for Node.js. It provides a unified interface for interacting with multiple database types, such as MySQL, PostgreSQL, and MongoDB. The library is designed to make database operations easier, more efficient, and secure.


🚀 Features

  • Unified Interface: Seamlessly interact with various databases through a common API.
  • Adapters for Multiple Databases: Supports MySQL, PostgreSQL, and MongoDB out of the box.
  • Connection Management: Provides efficient connection pooling and management.
  • Query Execution: Simplified methods for executing database queries.
  • Error Handling: Comprehensive error messages and logging.
  • Modular Design: Easily extendable to support additional databases.

📦 Installation

To install NPXBase, use npm or yarn:

npm install npxbase

or

yarn add npxbase

🛠️ Usage

Example: Connecting to MySQL

const { DBManager, MySQLAdapter } = require("npxbase");

(async () => {
  const mysqlAdapter = new MySQLAdapter();
  const db = new DBManager(mysqlAdapter);

  await db.connect({
    host: "localhost",
    user: "root",
    password: "password",
    database: "test_db",
  });

  const results = await db.query("SELECT * FROM users");
  console.log("Results:", results);

  await db.disconnect();
})();

Example: Connecting to PostgreSQL

const { DBManager, PostgresAdapter } = require("npxbase");

(async () => {
  const postgresAdapter = new PostgresAdapter();
  const db = new DBManager(postgresAdapter);

  await db.connect({
    host: "localhost",
    user: "postgres",
    password: "password",
    database: "test_db",
  });

  const results = await db.query("SELECT * FROM users");
  console.log("Results:", results);

  await db.disconnect();
})();

📖 API Reference

DBManager

The DBManager class is the core of NPXBase. It manages connections and executes queries.

Methods:

  • connect(config): Establishes a connection to the database.
  • disconnect(): Closes the connection to the database.
  • query(sql, params): Executes a SQL query with optional parameters.

Adapters

  • MySQLAdapter: Adapter for MySQL.
  • PostgresAdapter: Adapter for PostgreSQL.
  • MongoDBAdapter (planned): Adapter for MongoDB (coming soon).

⚙️ Configuration

Each adapter requires a configuration object to establish a connection. Examples:

MySQL Configuration

{
  host: "localhost",
  user: "root",
  password: "password",
  database: "test_db",
}

PostgreSQL Configuration

{
  host: "localhost",
  user: "postgres",
  password: "password",
  database: "test_db",
}

🧪 Testing

To run tests, install development dependencies and run the test script:

npm test

🌟 Contributions

Contributions are welcome! If you want to add new features, fix bugs, or improve the documentation, feel free to submit a pull request.


📜 License

NPXBase is licensed under the MIT License.