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

uranio

v1.0.4

Published

Uranio is a type-safe ODM for MongoDB

Readme

Uranio

uranio logo

Uranio is the lightest Typescript Object Document Mapper (ODM) for MongoDB, Object Relational Mapping (ORM) for MySQL, and DynamoDB.
It creates a client for querying collections/tables in a database by just parsing the types in a repository.

It is the simplest and fastest way to query a database without the need to build a Data Access Layer (DAL) from the defined types.

Install

Uranio uses peer dependencies for database SDKs, so you only install what you need:

For MongoDB users:

npm install uranio mongodb

For MySQL users:

npm install uranio mysql2

For DynamoDB users:

npm install uranio @aws-sdk/client-dynamodb @aws-sdk/util-dynamodb

How it works

Run:

uranio generate -d mongodb
// or
uranio generate -d mysql

The above command search for all interfaces in your repository that extends the uranio.atom interface.
For each of these interfaces it creates a method to query a collection with a name of the interface.

For example if in your code you have:

import uranio from 'uranio';

interface Product extends uranio.atom {
  title: string;
  description: string;
  price: number;
}

then Uranio generates a method for querying a collection named products:

import uranio from 'uranio';

const uri = process.env.MONGO_DATABASE_URI || '';
const dbName = process.env.MONGO_DATABASE_NAME || '';

const urn = uranio.MongoDBClient({uri, dbName});

// Get all products
const products = await urn.products.getAtoms({});

// Create a product
await urn.products.putAtom({
  title: 'Uranio mug',
  description: 'A radioactive mug for your coding breakfast',
  price: 4.99
});

Primary index _id for MongoDB

When extending an interface with uranio.atom (MongoDB) this add a primary index attribute _id to the interface, so there is no need to add it manually.

import uranio from 'uranio';

interface Product extends uranio.atom {
  title: string;
  description: string;
  price: number;
}
// It resolves in:
// {
//  _id: string;
//  title: string;
//  description: string;
//  price: number;
// }

Configuration

MySQL Client Options

When creating a MySQL client, you can configure additional options:

import uranio from 'uranio';

const uri = process.env.MYSQL_DATABASE_URI || '';

// Default: UTC timezone, no connection pool
const urn = uranio.MySQLClient({ uri });

// With connection pool
const urn = uranio.MySQLClient({
  uri,
  usePool: true
});

// Custom timezone (default is UTC '+00:00')
const urn = uranio.MySQLClient({
  uri,
  usePool: true,
  timezone: '+04:00'  // Dubai timezone (GST)
});

// Use local server timezone
const urn = uranio.MySQLClient({
  uri,
  timezone: 'local'
});

Timezone Parameter:

  • Default: '+00:00' (UTC) - All dates are stored in UTC
  • Custom: Any valid timezone offset like '+04:00' (Dubai), '+09:00' (Tokyo)
  • Local: 'local' - Uses the database server's timezone

The timezone setting affects how JavaScript Date objects are converted when storing to and retrieving from the database. Using UTC (default) is recommended for consistency across different timezones.

Troubleshooting

Missing Database SDK Error

If you get an error like:

Error: Cannot find module 'mongodb'
Error: Cannot find module 'mysql2'
Error: Cannot find module '@aws-sdk/client-dynamodb'

This means you haven't installed the required database SDK. Install the SDK for your chosen database:

# For MongoDB
npm install mongodb

# For MySQL
npm install mysql2

# For DynamoDB
npm install @aws-sdk/client-dynamodb @aws-sdk/util-dynamodb

Peer Dependency Warnings

When installing Uranio, npm may show peer dependency warnings. These are expected since Uranio supports multiple databases. You only need to install the SDK for the database you're actually using.

Credits

Logo credits https://www.jacopotripodi.com/