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 🙏

© 2026 – Pkg Stats / Ryan Hefner

toshell

v1.3.0

Published

Simple text logger for node application.

Readme

toshell

Simple text logger for node application. We create it for fast and beautiful logging.

  • Beautiful logging.
  • Light weight.
  • Log caller file and line number.
  • Create custom log type, then you can choose what you want to display at the moment without commenting out the line.
  • Global settings also avaliable for your project scope and environment.
  • Typescript Support

NPM


Change Log

v1.3.0

  • Add color functionality (light weight)

v1.2.0

  • Use default varialbe to access global instance
var toshell = require('toshell').default;//javascript
import {default as toshell} from 'toshell';//typescript
  • Now you can create new instance of toshell for further preference modification without effect default instance via toshellInstance.newInstance()

TODO

  • [ ] parse any object as pretty json format
  • [ ] cli command line
  • [ ] transfer log to web with interactive interface (json object viewer, filter, search)

Screenshot


Usage

var toshell = require("toshell").default;
toshell.log("Log using log()");
toshell.warn("Log using warn()");
toshell.error("Log using error()");
toshell.systemLog("Log using systemLog()");
toshell.line();//log line
toshell.section("This is Section");

var myFuntion = function () {
	toshell.logFunction("Log within closure function using logFunction()");
};
myFuntion();

toshell.setPreference({projectID:"MY_PROJECT"});
toshell.log("Logging after setPreference({projectID}) ");

Preference

Preference can set at any point of the application.

It's will apply to all usage afterwards, by default.

var toshell = require("toshell").default;
toshell.setPreference({
	projectID : "MY_PROJECT"
});

or

var toshell = require("toshell").default;
toshell.setPreference({
	displaySystemLog : true, //display log that calls via logger.systelLog
	displayDate      : false, //display date
	displayTime      : true, //display time
	displayFile      : true, //display script path for each line
	displayProjectID : true, //display project id
	displayInfo      : true, //display additional information
	displayIcon      : true, //display icon
	fileMaxLength    : 30, //set maximum length of file path
	verboseLogTypeArray: [], //disable some log type when use logger.logWithType 
	projectID          : "LOG" //project id
});

You can create local instance and change logging behavior

var toshell = require("toshell").default;//import default instance
var localToShell = toshell.newInstance({projectID:"LOCAL"});
//Or
var localToShell = toshell.newInstance({projectID:"LOCAL"}, true);//Copy configuration from current instance
//use localToShell
localToShell.log('Log something');

Playing around with preference

Try it yourself

var toshell = require("toshell").default;
toshell.section("Playing with indent");
toshell.log("Line 1");
toshell.logWithTab("Line 2");
toshell.logWithTab("Line 3");

toshell.section("Playing with preference");

//create new instance of toshell
var localToShell = toshell.newInstance({projectID:"LOCAL"});

localToShell.log("Create local instance and set projectID:\"LOCAL\"");

localToShell.setPreference({displayFile:false});
localToShell.warn("displayFile:false");

localToShell.setPreference({displayTime:false});
localToShell.error("displayTime:false");

toshell.log('Log from GLOBAL instance');
localToShell.log('Log from LOCAL instance');

Color Usage

Built-in color functionality (light-weight)

var toshell = require('toshell').default;//javascript
toshell.log(`Log with ${toshell.color('red','happy red')} color`);
/*
Here is the list of color you can use
'_reset' |
'txt_bright' |
'txt_dim' |
'txt_underscore' |
'txt_blink' |
'txt_reverse' |
'txt_hidden' |
'black' |
'red' |
'green' |
'yellow' |
'blue' |
'magenta' |
'cyan' |
'white' |
'bg_black' |
'bg_red' |
'bg_green' |
'bg_yellow' |
'bg_blue' |
'bg_magenta' |
'bg_cyan' |
'bg_white' 
*/