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

@cutticat/types

v1.8.0

Published

CuttiCat Types Library

Readme

@cutticat/types

TypeScript type library.

Contents

Overview

This library provides a set of useful TypeScript types for working with strings, objects, nullability, mutability, and HTTP. The types are optimized for strict TypeScript projects and provide compile-time type safety.

Installation

pnpm i @cutticat/types

Quick start

import type {
  ToCamelCase,
  ToSnakeCase,
  DeepReadonly,
  FullyUndefinable,
  PathParams,
} from "@cutticat/types"

// String transformations
type CamelCase = ToCamelCase<"hello-world"> // "helloWorld"
type SnakeCase = ToSnakeCase<"helloWorld">   // "hello_world"

// Working with objects
type ReadonlyConfig = DeepReadonly<{ name: string; age: number }>
type OptionalConfig = FullyUndefinable<{ name: string; age: number }>

// HTTP path parameters
type Params = PathParams<"/users/:id/posts/:postId"> // { id: string; postId: string }

API

Strings

Case conversion:

  • ToCamelCase<S> — converts to camelCase
  • ToSnakeCase<S> — converts to snake_case
  • ToPascalCase<S> — converts to PascalCase
  • ToKebabCase<S> — converts to kebab-case

Prefixes and suffixes:

  • RemovePrefix<T, Prefix> — removes a prefix
  • RemoveSuffix<T, Suffix> — removes a suffix

Utilities:

  • ReplaceAll<S, From, To> — replaces all occurrences of a substring

Objects

  • PrefixKeys<T, Prefix> — adds a prefix to all keys
  • KeysStartingWith<T, Prefix> — keys starting with a prefix
  • Key — any valid object key (string | number | symbol)
  • OwnKey — key type from Reflect.ownKeys(obj) (string | symbol)
  • KeyToOwn<T> — converts Key to OwnKey (numberstring)
  • CleanOmit<T, K>Omit without the string key artifact on objects with an index signature
  • ExcludeFromProperties<T, E> / DeepExcludeFromProperties<T, E> — excludes values from properties
  • IsPlainObject<T> — checks whether a value is a plain object

Nullability (nulls)

  • DeepRequired<T> — all properties are required
  • DeepPartial<T> — all properties are optional
  • DeepNonNullable<T> — recursively removes null and undefined (mirror of DeepNullish<T>)
  • DeepNonNullableRequired<T> — removes null/undefined and makes all properties required
  • Nullish<T> / DeepNullish<T> — nullable properties (null | undefined)
  • Undefinable<T> / DeepUndefinable<T> — properties allow undefined
  • FullyUndefinable<T> / DeepFullyUndefinable<T> — all properties are optional and allow undefined
  • IsOptional<T, K> — property K in T is declared optional
  • HasUndefined<T>undefined is part of the value type
  • CopyOptionalAndUndefined<Source, Target, Keys?> — values from Target by key, copying optionality and undefined from Source

Mutability

  • DeepReadonly<T, LocalExceptions?> — recursively makes all properties readonly
  • DeepWritable<T, LocalExceptions?> — recursively removes readonly
  • ReadonlyDate — Date without mutation methods
  • Immutable, DeepReadonlyExceptions — exception mechanism for DeepReadonly/DeepWritable

HTTP

  • HttpMethod — union of all HTTP methods
  • HttpStatusCode — union of all HTTP status codes
  • PathParams<Path> — extracts :param parameters from a path string

Maybe (optional values)

  • MaybePromise<T> — value may be Promise<T> or synchronous T
  • MaybeArray<T> — value may be an array T[] or a single T

Common

  • UnionToIntersection<Union> — converts a union to an intersection
  • Simplify<T> — simplifies object type display (useful after intersections and conditional types)

Documentation

Detailed documentation:

Full API documentation is available in JSDoc comments. Use IDE autocomplete to browse it.

Requirements

  • Node.js >= 22.0.0
  • pnpm >= 10.17.0
  • TypeScript >= 5.9.0