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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tapjs/node-serialize

v4.0.0

Published

Stream TAP test data as a serialized node:test stream

Downloads

593,706

Readme

@tapjs/node-serialize

A default tap plugin that serializes the output of root TAP test for consumption by the node --test runner.

That is, this is for running tests that you write like:

import t from 'tap'
t.pass('this is fine')
// etc

and then run with node --test.

USAGE

This plugin is installed with tap by default. If you had previously removed it, you can tap plugin add @tapjs/node-serialize to bring it back.

When enabled, this plugin is activated when the NODE_TEST_CONTEXT environment variable is set to child-v8. When so activated, the root TAP test outputs a stream of node:test message objects (ie, the data emitted by Node's TestStream class) to standard output, instead of piping TAP data to standard output.

It has no effect on other tests within the suite.

To disable this behavior, run tap plugin rm @tapjs/node-serialize.

Caveat about Timing

Node-tap and node's built-in node:test are not quite identical in their approach.

Specifically, they have very different approaches to asynchronous testing. When using node:test, all tests are placed in a queue, and de-queued and started by level. It is considered an error for a test to perform any asynchronous actions outside of the scope of its parent suite method.

In tap, when t.jobs is set to some number greater than 1, tests may run in any order, and their subtests may also run in any order, at the same time as its siblings. While a subtest will never start before its parent, it may start after its parent's sibling tests, making the apparent nesting get interleaved in a strictly event-stream based tracking.

To handle this, this serializer creates a tree of subtests, and only emits the relevant node:test event messages all at once, in the correct order that node --test expects.

The downside of this is that it may appear that tests hang and then emit all of their data at once. If true in-progress reporting is desired, then you're probably better off using tap's built-in test runner.