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

ts-normify

v1.0.1

Published

Fix those unconventional names coming from outside your beautiful codebase. With Typescript!

Readme

Fix those unconventional names coming from outside your beautiful codebase. With Typescript!

Table of Contents

Features

  • Super easy to use normalization functions.
  • Guaranteed type safety by exhaustive testing comparing types with runtime results.
  • Offers multiple normalization (and denormalization) strategies.

API

  • stringNormify(param: string, casing?: "Pascal" | "Camel") → string Converts a single string to camelCase or PascalCase

  • tsNormify(param: object | array, casing?: "Pascal" | "Camel") → object | array Deep: recursively transforms ALL nested keys to camelCase or PascalCase

  • keyNormify(param: object | array, casing?: "Pascal" | "Camel") → object | array Shallow: only transforms top-level keys to camelCase or PascalCase

  • mapNormify(mapping: Record<string, string>) → { normalize, denormalize } More strict key mapping with reversible transform

Installation

You can install ts-normify like any other npm package. Simply use your favorite package manager, we recommend pnpm:

pnpm add ts-normify

Who is this for?

  • Projects with backends that return inconsistently named keys (snake_case, kebab-case, PascalCase, etc.)
  • Projects that already have a transformation layer and are looking for a better, more tested utility to replace/enhance it
  • Devs who want type-safe normalization of data without manually redefining interfaces
  • Devs who don't want ugly key or string transformations scattered throughout their codebase

Who is this NOT for?

  • If you have control over the backend: it's way better to not add a frontend dependency and just fix the naming scheme there instead
  • Large codebases with tsc performance issues: ts-normify's deep types can slow down TypeScript's language server on very large projects. Meaning, type errors become sluggish, IDE seems unresponsive to type changes, worsening the developer experience. In those cases the brute force approach of having to name your own internal interface for every response is probably your best bet.

Things to consider

Since this package is based on the idea of normalizing responses from sources you don't control, there's a set of things to consider:

  • tsNormify, keyNormify and mapNormify all work with strictly serializeable data structures
  • All key/string normalizations treat special characters as spaces, so something like "hansel & gretel" will be normalized to "hanzelGretel". See src/tests/stringNormify.test.ts for more examples.
  • In the current implementation, special characters are defined as "characters that don't change between lowercase and uppercase".

Contributing

We are open to contributions from the community! Please make sure to follow the Code of Conduct while contributing.