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

@megaorm/utils

v1.0.0

Published

This package provides utility functions to validate whether a value is a MegaORM driver or a connection.

Readme

MegaORM Utils

This package provides utility functions to validate whether a value is a MegaORM driver or a connection.

Installation

To install this package, run the following command:

npm install @megaorm/utils

Functions

isDriver(driver): Ensures that the given value is one of MegaORM's supported drivers: @megaorm/mysql, @megaorm/sqlite, or @megaorm/pg.

const { isDriver } = require('@megaorm/utils');

console.log(isDriver({})); // false

Returns true if the value is a valid MegaORM driver, false otherwise.

isMySQL(driver): Ensures that the given value is a @megaorm/mysql driver.

const { isMySQL } = require('@megaorm/utils');

console.log(isMySQL({})); // false

Returns true if the value is the MySQL driver, false otherwise.

isPostgreSQL(driver): Ensures that the given value is a @megaorm/pg driver.

const { isPostgreSQL } = require('@megaorm/utils');

console.log(isPostgreSQL({})); // false

Returns true if the value is the PostgreSQL driver, false otherwise.

isSQLite(driver): Ensures that the given value is a @megaorm/sqlite driver.

const { isSQLite } = require('@megaorm/utils');

console.log(isSQLite({})); // false

Returns true if the value is the SQLite driver, false otherwise.

isCon(connection): Ensures that the given value is a MegaConnection — a connection created by any MegaORM driver.

const { isCon } = require('@megaorm/utils');

console.log(isCon({})); // false

Returns true if the value is a MegaConnection, false otherwise.

isPendingCon(connection): Ensures that the given value is a MegaPendingConnection — a connection that could not be closed by MegaPool.

const { isPendingCon } = require('@megaorm/utils');

console.log(isPendingCon({})); // false

Returns true if the value is a MegaPendingConnection, false otherwise.

isPoolCon(connection): Ensures that the given value is a MegaPoolConnection — a connection created by MegaPool.

const { isPoolCon } = require('@megaorm/utils');

console.log(isPoolCon({})); // false

Returns true if the value is a MegaPoolConnection, false otherwise.

Usage Examples

const { isDriver, isSQLite, isCon } = require('@megaorm/utils');

const { SQLite } = require('@megaorm/sqlite');

// Create a driver instance
const driver = new SQLite(':memory:');

// Ensure it's an SQLite driver instance
if (isSQLite(driver)) {
  console.log('This is an SQLite driver!');
}

// Ensure it's a MegaORM driver instance (SQLite, PostgreSQL, MySQL)
if (isDriver(driver)) {
  console.log('This is a MegaORM driver!');
}

// Create a connection
driver.create().then((connection) => {
  // Ensure it's a MegaConnection
  if (isCon(connection)) {
    console.log('This is a MegaConnection!');
  }
});