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

tap-invert

v1.0.0

Published

Inverts STDOUT lines in Tap output so they come after the assertion line

Downloads

2

Readme

Tap Invert

This util takes STDOUT generated during a test run and puts it below the corresponding assertion line. This is useful for piping to certain other tap reporters which expect the corresponding extra lines to be below the assertion, ex. tap-html

Example usage:

LOG_LEVEL=debug bundle exec rspec --order rand --format RspecTap::Formatter | tap-invert | tap-html

Example inverted output with Rails logger

$ cat example.tap | tap-invert
1..2
# MyClass
# MyClass.MySpec
ok 1 - MyClass::MySpec do_it does it
D, [2018-01-12T21:18:33.829999 #50430] DEBUG -- :     0 rows, 0 bytes
D, [2018-01-12T21:18:33.830057 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.831636 #50430] DEBUG -- :     0 rows, 0 bytes
D, [2018-01-12T21:18:33.831658 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.832574 #50430] DEBUG -- :     0 rows, 0 bytes
D, [2018-01-12T21:18:33.832594 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.833568 #50430] DEBUG -- :     0 rows, 0 bytes
D, [2018-01-12T21:18:33.833590 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.834634 #50430] DEBUG -- :     0 rows, 0 bytes
D, [2018-01-12T21:18:33.834663 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.840591 #50430] DEBUG -- :     405 rows, 24645 bytes
D, [2018-01-12T21:18:33.840617 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.844848 #50430] DEBUG -- :     1 rows, 11 bytes
D, [2018-01-12T21:18:33.844872 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.852862 #50430] DEBUG -- :     1 rows, 1 bytes
D, [2018-01-12T21:18:33.852918 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.854212 #50430] DEBUG -- :   ActiveRecord::SchemaMigration Load (0.8ms)  SELECT "schema_migrations".* FROM "schema_migrations"
D, [2018-01-12T21:18:33.854826 #50430] DEBUG -- :     40 rows, 560 bytes
D, [2018-01-12T21:18:33.854846 #50430] DEBUG -- :
D, [2018-01-12T21:18:33.856871 #50430] DEBUG -- :     1 rows, 37 bytes
D, [2018-01-12T21:18:33.856894 #50430] DEBUG -- :
Randomized with seed 21869
D, [2018-01-12T21:18:34.407022 #50430] DEBUG -- :    (0.5ms)  BEGIN
D, [2018-01-12T21:18:34.431372 #50430] DEBUG -- :     11 rows, 408 bytes
D, [2018-01-12T21:18:34.431410 #50430] DEBUG -- :
D, [2018-01-12T21:18:34.434122 #50430] DEBUG -- :     1 rows, 1 bytes
D, [2018-01-12T21:18:34.434150 #50430] DEBUG -- :
D, [2018-01-12T21:18:34.436942 #50430] DEBUG -- :     1 rows, 2 bytes
D, [2018-01-12T21:18:34.436967 #50430] DEBUG -- :
D, [2018-01-12T21:18:34.444503 #50430] DEBUG -- :    (0.5ms)  SAVEPOINT active_record_1
D, [2018-01-12T21:18:34.469430 #50430] DEBUG -- :   User Exists (1.0ms)  SELECT  1 AS one FROM "users"  WHERE ("users"."email" = '[email protected]' AND "users"."role_id" = 1) LIMIT 1
D, [2018-01-12T21:18:34.472014 #50430] DEBUG -- :     0 rows, 0 bytes
D, [2018-01-12T21:18:34.472044 #50430] DEBUG -- :
D, [2018-01-12T21:18:34.475157 #50430] DEBUG -- :   SQL (0.9ms)  INSERT INTO "users" ("created_at", "email", "name", "role_id", "token", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"  [["created_at", "2018-01-13 03:18:34.472160"], ["email", "[email protected]"], ["name", "Some Name 1"], ["role_id", 1], ["token", "EN_li2Q"], ["updated_at", "2018-01-13 03:18:34.472160"], ["user_id", 1]]
D, [2018-01-12T21:18:34.477333 #50430] DEBUG -- :     1 rows, 5 bytes
D, [2018-01-12T21:18:34.477364 #50430] DEBUG -- :
D, [2018-01-12T21:18:34.477987 #50430] DEBUG -- :    (0.4ms)  RELEASE SAVEPOINT active_record_1
D, [2018-01-12T21:18:34.568130 #50430] DEBUG -- :    (0.7ms)  ROLLBACK
ok 2 - MyClass::MySpec #do_it does not do it when state is wrong
D, [2018-01-12T21:18:34.569400 #50430] DEBUG -- :    (0.3ms)  BEGIN
D, [2018-01-12T21:18:34.573490 #50430] DEBUG -- :    (0.3ms)  SAVEPOINT active_record_1
D, [2018-01-12T21:18:34.574540 #50430] DEBUG -- :   User Exists (0.4ms)  SELECT  1 AS one FROM "users"  WHERE ("users"."email" = '[email protected]' AND "users"."role_id" = 1) LIMIT 1
D, [2018-01-12T21:18:34.575792 #50430] DEBUG -- :     0 rows, 0 bytes
D, [2018-01-12T21:18:34.575816 #50430] DEBUG -- :
D, [2018-01-12T21:18:34.576876 #50430] DEBUG -- :   SQL (0.4ms)  INSERT INTO "users" ("created_at", "email", "name", "role_id", "token", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"  [["created_at", "2018-01-13 03:18:34.575887"], ["email", "[email protected]"], ["name", "Some Name 2"], ["role_id", 1], ["token", "EDBhJN0"], ["updated_at", "2018-01-13 03:18:34.575887"], ["user_id", 2]]
D, [2018-01-12T21:18:34.578055 #50430] DEBUG -- :     1 rows, 5 bytes
D, [2018-01-12T21:18:34.578078 #50430] DEBUG -- :
D, [2018-01-12T21:18:34.638803 #50430] DEBUG -- :    (0.4ms)  ROLLBACK TO SAVEPOINT active_record_1
D, [2018-01-12T21:18:34.642678 #50430] DEBUG -- :    (0.4ms)  ROLLBACK