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

@tng-sh/js

v0.2.8

Published

TNG JavaScript CLI

Readme

@tng-sh/js: TNG JavaScript CLI

High-performance test generation and context analysis for JavaScript/TypeScript, powered by Rust (NAPI-RS and OXC).

Installation

Install the package as a development dependency in your project:

npm install @tng-sh/js --save-dev

Usage

1. Initialize

First, run the init command to create a tng.config.js configuration file. This file stores your API keys and project settings.

npx tng init

2. Interactive Mode (TUI)

The most powerful way to use TNG is via the high-performance terminal interface. It provides a guided experience for all analysis tasks.

npx tng i

Capabilities in TUI:

  • Generate Tests: Guided test creation for methods, components, and utilities.
  • Audit Method: Deep security, performance, and best-practice auditing.
  • Trace Method: Symbolic execution and logic flow visualization.
  • X-Ray Method: Deep dependency and side-effect analysis.
  • Check Duplicates: High-performance clone detection across the codebase.
  • Dead Code: Identify unreachable logic and unused variables/parameters.
  • User Stats: Review your usage metrics and generation history.

3. Command Line Interface (CLI) ⚙️

For direct execution or integration into scripts.

# See file outline and method list
npx tng -f path/to/file.js --outline

# Generate tests for a specific method
npx tng -f path/to/file.js -m functionName -t react_component

# Check for code clones
npx tng -f path/to/file.js --clones

Supported Types (-t): react_component, express_handler, graphql_resolver, nest_js, orm_model, background_job, mailer, utility.

4. Machine-Readable Output (--json) 🤖

Add the --json flag to any command to receive output as structured JSON events. This is ideal for CI/CD pipelines or custom integrations.

npx tng -f path/to/file.js --clones --json

4. Dead Code Analysis

Identify unreachable code, unused variables, and unused imports in your project:

npx -p @tng-sh/js tng --deadcode -f path/to/file.js

Features

  • Blazing Fast Static Analysis: Powered by Rust and the oxc parser for near-instant AST processing.
  • Interactive Terminal UI: Dual-pane keyboard-driven interface for deep code exploration.
  • Smart Visualization: Generate logic flow diagrams using Mermaid.js integration.
  • Dead Code Cleanup: Find and remove unused imports, variables, and unreachable logic.
  • First-Class TS & React: Native support for TypeScript, JSX, and TSX.

Configuration

Your tng.config.js allows for full customization:

module.exports = {
  API_KEY: "your-api-key-here",
  API_URL: "https://app.tng.sh/",
  FRAMEWORK: "express",        // Options: express, nextjs, nestjs, generic
  TESTS_PATH: "tests",         // Where to save generated tests
  TEST_FRAMEWORK: "jest"       // Options: jest, mocha, vitest
};