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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jtm

v1.2.1

Published

轻量级 JS 测试工具

Downloads

35

Readme

jtm

如果你用过 ava、tap,会发现它们的执行速度真的很慢。特别是 ava 慢的难以置信,且大量占用 CPU,导致糟糕的开发体验。

tape 性能还不错,但它依然是个半成品,需要自行扩充,而且必须使用 end()方法来结束测试代码,这样做似乎显得有些多余。

特性

  • 启动和执行速度超快

  • 轻量无依赖

  • 使用 ava 测试代码风格,部分兼容 ava 测试代码

  • 仅使用 node.js 内置的 assert 断言模块

示例

import test from "jtm";

test("hello", (t) => {
  t.deepEqual({ a: 1 }, { a: 1 });

  t.equal(true, true);
});

test("async", async (t) => {
  t.equal(true, true);

  t.ok(true);
});

安装

全局安装,运行时自动注入依赖包

npm install jtm -g

命令行参数使用

jtm 命令在无参数时默认执行 test 目录下的所有.js 测试文件。

# 未指定路径时,默认执行./test/目录下的所有.js文件
jtm

# 执行指定目录下的全部.js文件
jtm ./test/abc/

# 执行完整路径的单个.js文件
jtm ./test/abc.js

# 执行完整路径的单个.js文件,且仅执行指定名称的最小测试单元
jtm ./test/index.js:hello