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

@motiro/types

v0.1.1

Published

Shared TypeScript utility types for the Motiro toolkit — type-level helpers with zero runtime footprint.

Readme

@motiro/types

Shared TypeScript utility types for the Motiro toolkit — type-level helpers with zero runtime footprint.

npm version license

A curated collection of utility types: object transformers (Merge, PartialDeep, Prettify, …), string-character unions (Letter, Digit, …), numeric helpers, and general-purpose utilities like Branded, LiteralUnion, and Nullable. Types only — nothing ships to your bundle.

Features

  • 🧠 Type-level only — no runtime code, zero bundle impact.
  • 🧱 Object transformers — deep/shallow partial & required, merge, prettify, writable, and more.
  • 🔤 String-character unionsLetter, Digit, Alphanumeric, Whitespace, and casing variants.
  • 🔢 Numeric helpersNumeric, Zero, and the string-tolerant NumberSafe.
  • 🏷️ Nominal typingBranded for distinct IDs and units; LiteralUnion for autocomplete-preserving unions.

Installation

# bun
bun add -D @motiro/types

# npm
npm install -D @motiro/types

# pnpm
pnpm add -D @motiro/types

# yarn
yarn add -D @motiro/types

Usage

import type { Branded, Merge, PartialDeep, LiteralUnion } from '@motiro/types';

type UserId = Branded<string, 'UserId'>;
type PostId = Branded<string, 'PostId'>;
// UserId and PostId are not assignable to one another

type A = { id: number; name: string };
type B = { name: boolean };
type Merged = Merge<A, B>; // => { id: number; name: boolean }

type Config = { db: { host: string; port: number } };
type Draft = PartialDeep<Config>; // => { db?: { host?: string; port?: number } }

type Size = LiteralUnion<'sm' | 'md' | 'lg'>;
const a: Size = 'sm'; // suggested by autocomplete
const b: Size = 'xl'; // still allowed

API

Object

| Type | Description | | --- | --- | | Dict<T = unknown> | Plain string-keyed object with values of type T. | | Prettify<T> | Flattens intersections/mapped types into a readable object (cosmetic). | | PrettifyDeep<T> | Recursive Prettify, at every depth. | | PartialBy<T, K> | Makes the selected keys K optional. | | PartialExcept<T, K> | Makes everything optional except K. | | PartialDeep<T> | Recursively optional at every depth. | | PartialNullable<T> | Optional properties that also accept null. | | RequiredDeep<T> | Recursively required at every depth. | | ValueOf<T> | Union of all value types (the keyof counterpart). | | Writable<T> | Removes readonly from all properties. | | Merge<T, U> | Merges two objects; U wins on key overlap. |

String

| Type | Description | | --- | --- | | UppercaseLetter | A single 'A''Z'. | | LowercaseLetter | A single 'a''z'. | | Letter | Any single ASCII letter. | | Digit | A single '0''9'. | | Alphanumeric | A letter or a digit. | | Whitespace | ' ', '\t', '\n', or '\r'. |

Number

| Type | Description | | --- | --- | | Numeric | number \| bigint. | | Zero | 0 \| 0n. | | NumberSafe | A number or a numeric-literal string (number | `${number}`). |

Utility

| Type | Description | | --- | --- | | Nullable<T> | T \| null \| undefined. | | Maybe<T> | Alias of Nullable<T>. | | Optional<T> | Strips null, ensures undefined is allowed. | | Branded<T, B> | Nominal ("branded") type distinct from its base T. | | LiteralUnion<Known, Base = string> | Literal union that stays widenable while preserving autocomplete. |

License

MIT © meluiz