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

@typepurify/cli

v0.5.10

Published

Scaffolding and analysis CLI.

Readme


npm version

🚀 Overview

@typepurify/cli contains scripts and programmatic APIs to manage monorepos, validate .env files, analyze bundles, and scaffold new projects.

📦 Installation

npm install -g @typepurify/cli

🛠 Features & Examples

1. .env Validation & Generation

Programmatically parse, validate, and auto-generate .env.example files to keep your team's environments synced.

import { EnvValidator, generateEnvExample } from '@typepurify/cli';

// Ensure required keys exist
const validator = new EnvValidator(envContent);
const missing = validator.validate(['DATABASE_URL', 'API_KEY']);

// Scan source files for process.env.* usages and create a .env.example
const example = generateEnvExample(['./src/index.ts', './src/app.ts']);

2. Monorepo Dependency Analysis

Find unused or duplicate dependencies across your package.json files to reduce bloat.

import { findDuplicateDependencies, findUnusedDependencies } from '@typepurify/cli';

const duplicates = findDuplicateDependencies([pkg1, pkg2]);
const unused = findUnusedDependencies(pkg1, ['./src/index.ts']);

3. Project Scaffolding

Bootstrap a minimal Node or React project instantly.

import { bootstrapProject } from '@typepurify/cli';

bootstrapProject('./my-app', 'react');

4. Health & Bundle Analytics

import { runHealthScorer, analyzeBundleSize } from '@typepurify/cli';

const score = runHealthScorer('./src', true);
const bundle = analyzeBundleSize('./dist');
console.log(`Bundle Size: ${bundle.totalSizeBytes} bytes`);

5. Terminal Formatting

Format success, warning, and error messages elegantly for your CLI outputs.

import { formatError, formatSuccess, formatWarning } from '@typepurify/cli';

console.log(formatSuccess('Task completed successfully!'));
console.log(formatWarning('Deprecated flag used'));
console.error(formatError('Task failed'));

🆕 New in v0.5.8

generateDockerComposeYaml(...) — Docker Compose Generator

Generates a Docker Compose v3.8 YAML string with service definition, port mapping, and environment variables.

import { generateDockerComposeYaml } from '@typepurify/cli';

const yaml = generateDockerComposeYaml('api', 'node:18-alpine', 3000, {
  NODE_ENV: 'production',
  PORT: '3000',
});

generateCiPipelineYaml(nodeVersion) — GitHub Actions Generator

Generates a GitHub Actions CI workflow YAML with install and test steps.

import { generateCiPipelineYaml } from '@typepurify/cli';

const yaml = generateCiPipelineYaml('20.x');
// Outputs: name: CI, on: [push, pull_request], ...

🛡️ License

MIT © Vallarasu Kanthasamy


📋 Changelog

v0.5.4 — Latest

New Features:

  • runCodemodEngine(sourceCode, transforms) — Applies a list of string or regex transformations to source code programmatically. Designed for automated code migrations and refactoring scripts.
import { runCodemodEngine } from '@typepurify/cli';

const updated = runCodemodEngine('var x = 1; var y = 2;', [
  { from: /var/g, to: 'const' },
  { from: 'x', to: 'myVar' },
]);
// => "const myVar = 1; const y = 2;"

Bug Fixes:

  • analyzeBundleSize now uses fs.lstatSync instead of statSync to correctly ignore symlinks and avoid double-counting linked files.

v0.5.1

  • Added formatError, formatSuccess, formatWarning ANSI terminal formatters.
  • Added formatTable for ASCII table rendering.
  • Added runHealthScorer for project health analysis.

0.5.8 Updates

Includes new features.