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-function-inliner

v0.2.1

Published

TypeScript transformation that inlines calls to small functions. ⚡️

Readme

Explanation

Many projects choose to extract common shared logic into small helper functions. TypeScript projects often use small user-defined type guards to inform type narrowing. Unfortunately, the overhead of extracting logic into functions can hurt application performance before JIT optimizers fully kick in.[^1]

This TypeScript transformation plugin detects calls to small one-line functions and inlines them in the output JavaScript. The resultant code will function the same regardless of the transformation.

Example

Given the following function:

export function isNotFalsy(value: unknown) {
	return !!value;
}

Before:

export const value = isNotFalsy("Hello!");

After:

export const value = !!"Hello!";

Note: this transformer does not remove the original function declarations. Use a separate tool after the transform, such as Terser, if you'd like to configure that.

Usage

npm i ts-function-inliner

Per github.com/Microsoft/TypeScript/issues/14419, TSConfig plugins don't support transformers. However, you can use this in other pipelines.

Usage with Gulp

Specify it as a custom transformer with gulp-typescript:

import gulp from "gulp";
import ts from "gulp-typescript";
import { transformerProgram } from "ts-function-inliner";

gulp.task("typescript", function () {
	gulp
		.src("src/**/*.ts")
		.pipe(
			ts({
				getCustomTransformers: (program) => ({
					before: [transformerProgram(program)],
				}),
			}),
		)
		.pipe(gulp.dest("lib"));
});

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! ⚡

Contributors

💝 This package was templated with create-typescript-app using the Bingo engine.

[^1]: See Microsoft/TypeScript: Added some Type type predicates internally #50010, which caused a 1-2% performance hit in TypeScript.