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

@squirrel-forge/node-util

v1.6.0

Published

Collection of node utilities

Downloads

4

Readme

@squirrel-forge/node-util

Collection of basic node utilities, errors, terminal input, output, filesystem and more.

Installation

npm i @squirrel-forge/node-util

Usage

const { Class, function } = require( '@squirrel-forge/node-util' );

Notes

In prepareation of node version support changes, dependencies are softened and must be specified and/or documented by packages requiring them. [Breaking changes] since version ^1.4.0 all external dependencies were removed and made optional peer dependencies and therefore must be installed manually when required.

Optional dependencies

These dependencies are optional and only required when using the mentioned methods or classes. All of these must be installed manually, since they have been removed as direct dependencies.

Classes

  • CliInput( cfx, args, trimQuotes, false, true )
    • trimQuotes : boolean
    • hasArgs()
    • hasFlags()
    • flag( flag, default )
    • arg( index )
    • setArg( arg )
    • setFlag( flag )
    • getFlagsOptions( src )
    • eraseLastLine()
    • question( options )
    • ask( questions )
  • Exception( message, previous, options )
    • name : string
    • previous : *
    • stack : string
    • toString()
  • FsInterface : static
    • remote( url )*
    • remoteText( url )*
    • remoteJSON( url )*
    • read( file, enc )
    • readText( file )
    • readJSON( file )
    • exists( file, access )
    • write( file, content )
    • copy( source, target )
    • dir( dir )
    • isDir( dir )
    • unlink( file )
    • relative2root( dir, root )
    • filterOptions( options )
    • filterFiles( files, options )
    • files( dir, filter )
    • fileList( dir, options )*
    • fileListRecursive2Flat( tree, result )
    • treeWalker( tree, callback )
  • OutputBuffer()*
    • length : number
    • allowIntercept : boolean
    • flush()
    • reduce()
    • contents()
    • start()
    • end()
    • onIntercept( handler )
    • offIntercept( handler )
  • Progress()*
    • start( text, loop, safemode )
    • stop( keep )
  • StatsDisplay( cfx )
    • constructor
      • StatsDisplayException : StatsDisplayException constructor
      • StatsDisplayType : StatsDisplayType constructor
    • hasStyle( name )
    • styleAs( string, style, no-reset )
    • is_simple( value )
    • is_display_type( value )
    • show( value, result, level, heading )
    • parse( source, result )
    • display( source, output )
  • Timer
    • start( name )
    • get( name )
    • measure( name )
    • end( name )
  • Warning( message, previous, options ) extends Exception
    • name : string
    • previous : *
    • stack : string
    • toString()
    • toLocaleString()

Functions

  • callback( name, context, args )
  • cmd( command )
  • convertBytes( bytes, decimals, style, return, unit )
  • convertHrtime( time, seconds_suffix_separrator, milliseconds_suffix, return )
  • isPojo( obj )
  • isUrl( string )
  • leadingZeros( number, length, char, reverse )
  • parseInput( args )
  • prompt( once )
  • rand( min, max )
  • requireOptional( name, version, fatal )
  • round( value, decimals )
  • simpleReplace( template, data, prefix, suffix )
  • strand()
  • strSlug( string )
  • trimChar( string, remove, limit )
  • wait( ms )

Issues and docs

If you encounter any issues, please report here.


Check the sourcecode on github for detailed comments.