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-hover-prettify

v1.1.2

Published

Utility to make the hover of a typescript object more readable

Readme

ts-hover-prettify

Provide Prettify<T> so TypeScript hovers show a single object shape instead of a chain of intersections.

npm version npm downloads License: MIT

What is this?

This package exports the Prettify<T> utility type for projects where you want the type in source control or need tsc / CI without the VS Code extension. The extension injects the same type automatically — pick one approach per repo.

The mapped-type pattern only affects how TypeScript prints types in the language service. It is erased at compile time and does not change JavaScript output.

Quick Start

pnpm add -D ts-hover-prettify
# npm add -D ts-hover-prettify
# yarn add -D ts-hover-prettify

Global Prettify (recommended)

Create a declaration file included by your tsconfig.json, for example prettify.d.ts:

import "ts-hover-prettify/global";

Add it to compilerOptions.types, or to top-level include / files:

{
  "include": ["src/**/*", "prettify.d.ts"]
}

After that, Prettify is available everywhere in the project without importing it in each file.

Named import

import type { Prettify } from "ts-hover-prettify";

type Flat = Prettify<{ x: 1 } & { y: 2 }>;

Example

type Intersected = { a: string } & { b: number } & { c: boolean };
// Hover: { a: string; } & { b: number; } & { c: boolean; }

type Readable = Prettify<
  { a: string } & { b: number } & { c: boolean }
>;
// Hover: { a: string; b: number; c: boolean; }

Working example in this repo: examples/intersected-types-npm. Verify from the repo root:

pnpm verify:example-npm

API

export type Prettify<T> = {
  [K in keyof T]: T[K];
} & {};

Implementation matches the common community pattern (also documented as Compute, Expand, etc.).

Behaviour and limits

  • Wrap only the types where you care about hover readability. Unwrapped aliases keep their default display.
  • Works best on object intersections and similar shapes you intentionally pass into Prettify. It does not recursively “fix” every nested type in the project.
  • Requires TypeScript (peer usage via your project’s typescript version). This package ships type definitions only; it does not patch the compiler.

VS Code / Cursor without npm

Use the ts-hover-prettify-vscode extension instead of this package if you only need editor hovers and accept workspace injection of .vscode/ts-hover-prettify.d.ts.

Documentation

| Resource | Description | |----------|-------------| | Root README | Monorepo overview and install options | | Extension README | Zero-config editor setup | | CHANGELOG.md | Package release notes |

Contributing

Issues and pull requests are welcome on GitHub.

License

MIT — Copyright 2023 Marco Antolini.