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

tspew

v1.1.2

Published

A simple template printer for the JavaScript console

Downloads

6

Readme

TypeScript

TSpew

A simple template printer for the JavaScript console.

Install

npm install tspew

Options

| Name | Description | Type | | ----------------- | ---------------------------------------------------------------------------------------------------------- | ---------- | | resetEachLine | Automatically appends a reset to the end of each line of your template | boolean | | customerReplacers | An array of the Replacer type provided to add your own token replacers to the template | Replacer[] | | typeEffect | Enables the type effect, if you don't want this then just omit this option rather than setting it to false | boolean | | charDelay | Couples with typeEffect and applys a delay in ms between each character being displayed | number | | lineDelay | Adds a delay in ms between each line being printed to the console | number |

Default Supplied Tokens

| Token | Replacer | | ----------- | --------- | | %reset | \x1b[0m | | %bright | \x1b[1m | | %dim | \x1b[2m | | %underscore | \x1b[4m | | %reverse | \x1b[7m | | %tick | \u2713 | | %heavyTick | \u2714 | | %cross | \u2717 | | %heavyCross | \u2718 |

Preview

defaults

Example Usage

Create a template file in the root of your project

touch template

Build your template using built in replacers and hex codes or you can supply your own later!

%fgHex[473cc2] _____                           _        _____                    _       _
| ____|_  ____ _ _ __ ___  _ __ | | ___  |_   _|__ _ __ ___  _ __ | | __ _| |_ ___
|  _| \ \/ / _` | '_ ` _ \| '_ \| |/ _ \   | |/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \
| |___ >  < (_| | | | | | | |_) | |  __/   | |  __/ | | | | | |_) | | (_| | ||  __/
|_____/_/\_\__,_|_| |_| |_| .__/|_|\___|   |_|\___|_| |_| |_| .__/|_|\__,_|\__\___|
                          |_|                               |_|                    %reset

%bgHex[e37000]%fgHex[ffffff] Stats %reset

%fgHex[24d43b]%tick%reset Node Version: %fgHex[24d43b]20.12.0%reset
%fgHex[24d43b]%tick%reset Port: %fgHex[24d43b]3000%reset
%fgHex[d42424]%cross%reset Test Coverage: %fgHex[d42424]40%%reset

Call the template printer whenever you want to, for example when an express app starts

import express from "express";
import printTemplate from "tspew";

const app = express();

app.listen(3000, () => {
  printTemplate({ lineDelay: 20 });
});

example