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

@tsln/console

v0.1.1

Published

The Max console as a Console API object for [v8] scripts, with an install() that makes it the global console for bundled packages

Readme

@tsln/console

The Max console as a Console API object for [v8] scripts: log, info, warn, error, assert, trace, dir, table, group, count, time and the rest. Values are formatted by inspect(), which handles circular references, functions, Map and Set, errors, and summarises Max and Live objects (Maxobj, Dict, LiveAPI, LiveObject) instead of expanding their internals. A leading string can hold format specifiers (%s, %d, %i, %f, %o, %O, %j, %c, %%).

import console = require("./vendor/console");

console.log("tracks:", song.tracks); // tracks: [LiveObject<Track> live_set tracks 0, ...]
console.log("%d of %d", done, total);
console.error("no input on", index); // in red
console.warn("careful"); // "warning: careful", since the Max console has no warning level
console.group("connecting");
console.log("indented");
console.groupEnd();
console.time("render");
console.timeEnd("render"); // render: 12 ms
console.dir(deep, { depth: 6 }); // more than log() shows

The module is also callable, as a shorthand for log(), so import log = require("./vendor/console") and log("loaded") work too.

As the global console

A bundled npm package looks for console as a global. install() provides it, keeping a console Max supplies itself and adding only the methods it lacks:

console.install();
import thing = require("./vendor/thing");

Log file

logToFile(path) also writes every line to a file, timestamped and with its level; logToFile(null) stops. Use an absolute path.

Install

npm install --save-dev @tsln/console

Max's require() searches Max's file path and knows nothing of node_modules, so the package's single CommonJS file, dist/index.js, has to be copied or bundled to somewhere Max can find it (the max-msp repository bundles it to js/vendor/console.js with esbuild), with a declaration file next to it for the types:

// src/vendor/console.d.ts
import console = require("@tsln/console");
export = console;

The package depends on @tsln/max-types for the Max globals it calls (post, error, File).

Where the Console API has no Max equivalent: table posts the data like log, and clear does nothing, since a script can't clear the Max console.