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

pageant

v0.1.9

Published

A pretty-printing console module extracted from Warhorse.

Downloads

58

Readme

PAGEANT Build Status Coverage Status

Smart and seamless colored console output across all platforms.

Smart sheep?

No configuration necessary.

[ And no built-ins were harmed in the making of this movie! ]

ABOUT

I wanted to enhance the console output of a project I was working on. I needed color, certainly... but I also needed a smarter way to display more complex, structured information in the console e.g. table data or JS objects.

I looked at what was available on NPM and GitHub and searched for a single solution. After trying out and experimenting with about twenty different packages - and finding all of them missing something essential. I needed something:-

  • More capable than chalk.js, color.js, colour.js, col.js, etc etc...

..."Hey, where's my color orange?"

  • More standard than things like prettyjson

..."Look, I just wanted standard JSON... not this YAMLized 'something'!!!"

  • Lighter than terminal-kit.

..."I'm asking for better console output... not a rocket-ship with six different kitchen sinks and a dog kennel!"

  • And to work everywhere just the same. At least in both the browser and with Node.

"Ok, NPM search results: 0 ...help!!!"

So, finding nothing suitable... I did what any good coder would do... and wrote the solution myself!

I share it with you now... and I've called it Pageant! (After the ye old medieval-ly colorful procession thingies...)

But unlike the name, the code is implemented in - very modern - and very vanilla, JavaScript!

FEATURES

Ok then, go on... amaze me!

  • A safe drop-in replacement for the built-in console - supports all standard functionality.
  • Enriches, formats, syntax-hightlights the display of all data - for greater clarity and readability.
  • Supports all JS values, objects and code - as well as JSON objects and arrays.
  • Uses the full color palette available for 16, 256 and TrueColor capable consoles.
  • Works well out-the-box - but can easily be customised by code or by config file.
  • Simple to use.

INSTALLATION

npm install pageant

USAGE

Pageant is safe to use with existing code... just import and assign Pageant at the top of your script:-

    const Pageant = require("pageant");
    const console = new Pageant();

Then, just as you would normally:-

console.log("Hi there!!!");

console.log("%s %s!!!", "hi", "there");

console.log(123, 456);

console.warn("Warning: Ooh 'eck, something's happenin'.");

console.error("Error: Total, complete and absolute system failure and melt-down! Exiting the building is advised.");

or if you want enriched data you can:-

let valueA = 1;
let valueB = "1";
console.info(valueA);
console.info(valueB);

console.info({
    name: "Almost",
    middle: "A",
    last: "Person",
    isOnline: true
});

let arrayObjects = [
    {id: 10, first: "John", second: "Smith", age: 24, active: true},
    {id: 11, first: "John", second: "Harlow", age: 41, active: true},
    {id: 12, first: "Sally", second: "May", age: 28, active: false}
];
console.table(arrayObjects);

And you will also find that the normal 'dumb' alias of console.debug()... isn't so dumb anymore!

console.config.debug = true;
console.debug("This message will shows as debug-mode is set.");

console.config.debug = false;
console.debug("This message will no longer show in the production build.");

CONFIGURATION

TODO 
July 2017 - Currently Pageant Node functionality is being completed.
Browser support is still only partial at present.

DOCUMENTATION

Documentation about usage and configuration can be found in Wiki:Configuration page.

LICENSE

Pageant was written by Kyle Alexis Sargeant and is shared under the LGPL-3.0 license.

Thus, you can use it freely in anything - both open-source or commercial - without any need to disclose your own code.