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

js-dev-tool

v1.2.13

Published

`js-dev-tool` is a mixed package of `jstool` CLI commands and small Node.js helpers for JavaScript / TypeScript project maintenance.

Downloads

694

Readme

js-dev-tool

js-dev-tool is a mixed package of jstool CLI commands and small Node.js helpers for JavaScript / TypeScript project maintenance.

The published modules are CommonJS. The examples below use require(...) so the runtime behavior matches the package as published.

Install

npm i js-dev-tool

CLI Usage

jstool is the package binary and points to tools.js.

jstool -cmd <command_name> [options]
node tools.js -cmd <command_name> [options]
node tools.js -help <command_name>

Published Package Layout

This section reflects the current package.json#exports and package.json#files.

Stable Entry Points (exports)

| Path | Purpose | | --- | --- | | js-dev-tool | Root namespace object with { progress, common, utils } | | js-dev-tool/utils | File, JSON, CLI, TSV/CSV, and small utility helpers | | js-dev-tool/common | File-system and terminal rendering primitives | | js-dev-tool/progress | Progress renderer, spinner helpers, webpack / browserify progress hooks | | js-dev-tool/progress/progress-extras | Environment and webpack-version helpers | | js-dev-tool/extras/algorithms | Binary-search helper | | js-dev-tool/extras/cc-map | Character-code map | | js-dev-tool/extras/jsonl | JSONL readers, JSONL-to-array/map helpers, and jsonMinify | | js-dev-tool/extras/json-minify | jsonMinify | | js-dev-tool/extras/progress-light | Small fixed-frame spinner | | js-dev-tool/extras/tiny-progress | Random-frame spinner wrapper | | js-dev-tool/basic-types | Types-only reference entry |

Notes:

  • js-dev-tool/extras/list-deps-of is bundled and works at runtime, but it does not ship a .d.ts. If you want types, use listDependenciesOf from js-dev-tool/utils.
  • package.json exposes ./progress/*, but the currently documented typed JS subpath is js-dev-tool/progress/progress-extras. Other bundled files under progress/ should be treated as internal support assets unless you have verified the exact runtime file.

Additional Bundled Files (files)

The publish list is broader than the stable import surface above.

  • Root files: index.js, index.d.ts, utils.js, utils.d.ts, tools.js, tools.d.ts, basic-types.d.ts, tsconfig.json
  • Bundled directories: common/, extras/, lib/, progress/, scripts/, tool-lib/

Root Namespace

const { utils, common, progress } = require("js-dev-tool");

For clearer dependency boundaries, importing a direct subpath is usually better than pulling from the root namespace.

utils

js-dev-tool/utils is the main grab-bag module. A few useful exports:

  • extractVersion(versionString?)
  • removeJsonComments(source)
  • readText(path) / writeText(content, path)
  • readJson(path)
  • copyText(content, message?)
  • indexByCol(tsvSource, options) and parseDelimitedToIndex
  • listDependenciesOf(packageName) for Yarn v1 lockfiles

Example:

const { indexByCol, listDependenciesOf } = require("js-dev-tool/utils");

const map = indexByCol("id\tname\n1\talpha\n2\tbeta\n", {
  mapKeyCol: 0,
});

const deps = listDependenciesOf("webpack");
console.log(map["1"], deps.slice(0, 5));

common

js-dev-tool/common contains the low-level pieces used by the progress helpers.

  • checkParentDirectory(dest)
  • createLogStreamAndResolvePath(logPath)
  • renderLine(msg?, row?)
  • cursor(enabled, output?)

progress

js-dev-tool/progress is the main progress API.

  • createProgress(timeSpanMS, frames)
  • createProgressSync(frames, formatOpt?)
  • createProgressObject(frames, formatOpt, messageEmitter)
  • createWebpackProgressPluginHandler(logFilePath?, disableRenderLine?)
  • createBrowserifyFileEventLogger(logFilePath)

js-dev-tool/progress/progress-extras adds:

  • checkENV()
  • wppHandlerV4
  • wppHandlerV5
  • isWebpackV5later()

Extras Modules

The extras/ directory is where the smaller standalone modules live. Some are typed and ready to document as public helpers; some are runtime-only and better treated as advanced or legacy entry points.

js-dev-tool/extras/algorithms

Exports:

  • bnSearch(src, value, comparator)

Use this when you already have a sorted array and want a simple binary search helper.

const { bnSearch } = require("js-dev-tool/extras/algorithms");

const values = [1, 4, 7, 9];
const index = bnSearch(values, 7, (left, right) => left - right);

console.log(index); // 2

js-dev-tool/extras/cc-map

Exports a character-code map object. It is most useful when you want named constants for ASCII / control-character comparisons.

const CC_MAP = require("js-dev-tool/extras/cc-map");

console.log(CC_MAP.LF); // 10
console.log(CC_MAP.DOUBLE_QUOTE); // 34

js-dev-tool/extras/jsonl

Exports:

  • resolveJsonlPath(fileName, options?)
  • readJsonlLines(fileName, onLine, options?)
  • readJsonl(fileName, onRow, options?)
  • readJsonlArray(fileName, options?)
  • readJsonlMapByKey(fileName, options?)
  • fastGetIntFieldCheap(line, key)
  • jsonMinify(source)

This is the richest extras entry and the main one worth documenting. It covers three related jobs:

  • streaming JSONL line reads
  • JSON parse + row transformation
  • whitespace minification for JSON and JSONL

Key behaviors:

  • readJsonlLines splits by "\n" and trims a trailing "\r" from each physical line
  • empty lines are skipped by default
  • readJsonl reports parse failures through onParseError when provided, otherwise it logs to stderr
  • readJsonlMapByKey defaults to "_key" and lets later rows overwrite earlier rows
  • fastGetIntFieldCheap is intentionally narrow: it is meant for top-level integer fields on hot paths
  • jsonMinify accepts either a single JSON value or multiple top-level JSON values and returns minified JSONL in the multi-value case

Example:

const {
  readJsonlArray,
  readJsonlMapByKey,
  fastGetIntFieldCheap,
  jsonMinify,
} = require("js-dev-tool/extras/jsonl");

async function main() {
  const rows = await readJsonlArray("logs/app.jsonl", {
    filter: (row) => row.level !== "debug",
    map: (row) => ({
      id: row.id,
      level: row.level,
    }),
  });

  const byId = await readJsonlMapByKey("logs/app.jsonl", {
    keyField: "id",
  });

  console.log(rows.length, Object.keys(byId).length);
  console.log(fastGetIntFieldCheap("{\"count\":42}", "count"));
  console.log(jsonMinify("{ \"a\": 1 }\n{ \"a\": 2 }"));
}

main().catch(console.error);

js-dev-tool/extras/progress-light

Exports:

  • create(fps?, messageEmitter?)

progress-light is the simpler spinner. It uses a fixed dot-style frame set and returns a progress object with:

  • run()
  • stop()
  • renderSync()
  • setFPS(fps)
  • updateOptions(newFrames?, newOpt?)
  • deadline()
  • newLine()
  • isRunning()

Example:

const { create } = require("js-dev-tool/extras/progress-light");

const progress = create(12, () => "building...");
progress.run();

setTimeout(() => {
  progress.deadline();
  progress.stop();
  progress.newLine();
}, 800);

js-dev-tool/extras/tiny-progress

Exports:

  • create(fps?, messageEmitter?)

tiny-progress is similar to progress-light, but it delegates to js-dev-tool/progress and uses a random spinner frame set from the bundled progress resources.

Use this when you want a little more visual variety and do not care about choosing the exact frame list yourself.

const { create } = require("js-dev-tool/extras/tiny-progress");

const progress = create(20, () => "waiting for tasks...");
progress.run();

setTimeout(() => {
  progress.stop();
  progress.newLine();
}, 800);

Runtime-Only Extras

These modules are currently bundled, but they are not typed as standalone subpaths.

js-dev-tool/extras/json-minify

Exports:

  • jsonMinify(source)

This is the direct runtime entry for the JSON / JSONL whitespace remover. Prefer js-dev-tool/extras/jsonl if you want the same function with TypeScript support.

const { jsonMinify } = require("js-dev-tool/extras/json-minify");

console.log(jsonMinify("{ \"name\": \"alpha\" }"));

js-dev-tool/extras/list-deps-of

Exports:

  • listDependenciesOf(packageName)

This helper reads yarn.lock from process.cwd() and collects transitive dependencies for the named package.

Constraints:

  • Yarn v1 lockfile only
  • current working directory must contain the target yarn.lock
  • if you want types, import listDependenciesOf from js-dev-tool/utils instead
const { listDependenciesOf } = require("js-dev-tool/utils");

console.log(listDependenciesOf("typescript"));

Basic Types

js-dev-tool/basic-types is a types-only entry point.

/// <reference types="js-dev-tool/basic-types"/>

It is a small bag of utility types kept mainly for compatibility with older code.

Commands

Available jstool commands:

  • rws: record webpack or other bundle sizes
  • cjbm: convert JavaScript files to browser-compatible modules
  • cmtTrick: toggle comment-trick markers in source
  • replace: regex-based multi-file replacement
  • version: bump package.json versions and optional extra files
  • minify: minify JavaScript files with Terser
  • rmc: remove C-style comments
  • zip: create zip archives with an optional comment

Use jstool -help <command_name> for the full option list of each command.

Related Libraries

literate-regex

literate-regex was originally developed as part of this project, but it is now a separate package.

License

Released under the MIT License. See LICENSE for details.