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

run-test-files

v1.0.11

Published

runtf is a command line tool for running script files (tests) with a post name like '.test.ts' (default: '.tf.ts')

Downloads

24

Readme

Run-test-files

This is a cli tool: runtf

It scan for files with a postfix,
then list them in a select menu,
and run the selected file.

It can run typescript files*

Install

npm install -g run-test-files

Usage

runtf

Select Menu Example

First run

runtf

This will scan for files with the postfix .tf.ts and list them in a select menu:

Files:

📁 Some project root
┗ 📁 tf-tests
  ┗┳ Hello World (ts).tf.ts
   ┣ Hello World.tf.js
   ┗ Input test.tf.ts

Select menu:

? Select a test to run: (Use arrow keys)
❯ Exit
  ─── ⇓ Select test ⇓ ───
  Hello World
  Hello World (ts)
  Input test

Options

Usage: runtf [?options]
  Options:
    --help, -h                        show this help
    --dot                             include dot files
    --bun                             run test with Bun* (instead of node)
    --postfix, -p     [postfix]       postfix to search for fx testfile.tf.ts (default tf)
    --cwd, -c         [folder path]   root folder to search from  (default: process.cwd())
    --save, -s        [?filename]     save last test to file (default: .last-tf)
    --savenumber, -sn [?number]       number of test save to save last file (default: 1)
    --depth, -d       [depth]         max depth of folder to search (default: 10 max: 50)
    --config, -c      [file path]     path to tsconfig.json (default: tsconfig.json)
    --namepath -n                     include relative path in select name (fx: dir > dir > name)

  Debug:
    --debug                           print debug info (includes --noClear)
    --noClear, -nc                    don't clear terminal before test
    --noRun, -nr                      don't run test (just print debug info)

  *Bun:
    if this is run with bun, it will automatically run with bun (--bun)

Postfix

You can change the postfix to search for,
with the --postfix option

runtf --postfix mytest

This will search for files with the postfix .mytest.ts instead of .tf.ts

Save last test

You can save the last test to a file,
and run it again later with the --save option It will apper as the first option in the select menu.

You can specify a filename,
or use the default .last-tf

runtf --save mylasttest.txt

Run with Bun

You can run the test with Bun

Which have native support for typescript.
(No need to compile to javascript first)

You must have bun must be installed globally.

If you run the cli with bun it will automatically run with bun.

If you run it with node it run child process with bun by using --bun option

runtf --bun

TypeScript

runtf can run typescript files,
if typescript is installed and a root tsconfig.json file exist.

Use the --config option to specify another tsconfig.json file

runtf --config ./tsconfig.test.json

or

runtf --config ../

runtf will compile the typescript files to javascript before running it.

The js file name will have the same name, with ts replaced with js
and will be delete after running it.