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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jstracer

v1.2.10

Published

js tracer for the debug and file information

Downloads

10

Readme

nodejs tracer handle

tracer for multiple handles for use

Release History

  • Apr 1st 2019 Release 1.2.0 to fixup the console.error on get_stacks on Array.forEach nothing
  • Nov 28th 2017 Release 1.1.2 to fixup bug when call the output format of line and files
import * as jstracer from '../../lib';

const trace_exit = function(ec) {
    jstracer.finish(err => {
        if (err) {
            return;
        }
        process.exit(ec);
    });
};

process.on('uncaughtException', err => {
    'use struct';

    jstracer.error('error (%s) stack(%s)', err, err.stack);
    trace_exit(3);
});

process.on('SIGINT', () => {
    trace_exit(0);
});

const args = {
    verbose: 1,
    log_files: [],
    log_appends: [],
    log_console: true,
    log_format: '<{{title}}> {{message}}\n',
};

const value = 'code';
const lvalue = 32;

jstracer.set_args(args);

jstracer.error('value %s lvalue %s', value, lvalue);
jstracer.warn('value %s lvalue %s', value, lvalue);
jstracer.info('value %s lvalue %s', value, lvalue);
jstracer.debug('value %s lvalue %s', value, lvalue);
jstracer.trace('value %s lvalue %s', value, lvalue);

output

<error> [Z:\\jstracer\\libexample\\console\\console2.js:Object.<anonymous>:42] value code lvalue 32
<warn> [Z:\\jstracer\\libexample\\console\\console2.js:Object.<anonymous>:43] value code lvalue 32

to get the special case for special name


import * as jstracer from '../../lib';
import * as extargsparse from 'extargsparse';

const commandline = `{
  "logname|n" : null,
  "$" : "+"
}`;

const trace_exit = function(ec) {
    jstracer.finish(err => {
        if (err) {
            return;
        }
        process.exit(ec);
    });
};

process.on('uncaughtException', err => {
    'use struct';

    jstracer.error('error (%s) stack(%s)', err, err.stack);
    trace_exit(3);
});

process.on('SIGINT', () => {
    trace_exit(0);
});

let parser = extargsparse.ExtArgsParse({
    help_func(ec, s) {
        let fp;
        if (ec === 0) {
            fp = process.stdout;
        } else {
            fp = process.stderr;
        }
        fp.write(s);
        trace_exit(ec);
    },
});
parser.load_command_line_string(commandline);
parser = jstracer.init_args(parser);
const args = parser.parse_command_line();

const logger = jstracer.set_args(args,args.logname);
args.args.forEach(l => {
    logger.error('%s', l);
    logger.warn('%s', l);
    logger.info('%s', l);
    logger.debug('%s', l);
    logger.trace('%s', l);
});

shell call

node example2.js  -n logger1 -vvvv "hello world"

output

<error> [Z:\\jstracer\\libexample\\console\\logname.js::53] hello world
<warn> [Z:\\jstracer\\libexample\\console\\logname.js::54] hello world
<info> [Z:\\jstracer\\libexample\\console\\logname.js::55] hello world
<debug> [Z:\\jstracer\\libexample\\console\\logname.js::56] hello world
<trace> [Z:\\jstracer\\libexample\\console\\logname.js::57] hello world

reference for the key of args set

  • verbose is the verbose mode default 0 for just error output 1 for warn output 2 for info output 3 for debug output 4 for trace output
  • log_files to log into the file default none ,not to the file
  • log_appends : almost as log_files ,but append log to the end of the file
  • log_console : default true for stderr if false ,no logout to stdout
  • log_format : default '<{{title}}> {{message}}\n' will give the vivid