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

cando-util

v3.2.1

Published

utility functions for can-do web apps

Readme

cando-util

Utility functions for can-do web apps

📦 cando-util structure

  • browser.js → browser-safe functions only (no Node APIs)

  • server.js → everything, including Node tools like fs

  • index.js → routed by package.json, fallback to server build

    Usage: import { fn } from 'cando-util' // auto picks browser or server import { fn } from 'cando-util/browser' // always browser-safe version import { fn } from 'cando-util/server' // always full version

	"exports": {
		".": {							// auto routing
			"browser": "./browser.js",  // vite should pick up on this
			"default": "./server.js"
		},
		"./browser": "./browser.js",	// explicit import option
		"./server": "./server.js"		// explicit import option
	},

Adding a new function

  • copy an existing function and start from there.
  • then make sure you add the function and test function to the index.js file
  • then add the function only to the index.mjs file

Testing

  • for testing, do a npm link cando-util in the test folder
  • do a node test [testFunction] to test the individual function
  • then do node test to run all the tests

Updating the package

  • first, commmit changes
  • then we gotta move back to the root folder first
  • then do npm version minor || npm version patch
  • then just push changes

File Structure

michaelhartman@Michaels-MacBook-Pro cando-util % ls -al total 2472 drwxr-xr-x@ 21 michaelhartman staff 672 Nov 4 02:16 . drwxr-xr-x@ 26 michaelhartman staff 832 Sep 20 01:49 .. -rw-r--r--@ 1 michaelhartman staff 10244 Nov 4 02:16 .DS_Store drwxr-xr-x@ 15 michaelhartman staff 480 Nov 4 02:21 .git drwxr-xr-x@ 3 michaelhartman staff 96 Oct 16 2024 .github -rw-r--r--@ 1 michaelhartman staff 2058 Nov 4 01:37 .gitignore drwxr-xr-x@ 3 michaelhartman staff 96 Oct 16 2024 .vscode -rw-r--r--@ 1 michaelhartman staff 619 Aug 2 00:56 README.md -rw-r--r--@ 1 michaelhartman staff 77 Nov 2 18:47 browser.js -rw-r--r--@ 1 michaelhartman staff 5409 Nov 2 18:46 index.js -rw-r--r--@ 1 michaelhartman staff 5822 Nov 3 22:11 index.mjs drwxr-xr-x@ 101 michaelhartman staff 3232 Nov 4 00:42 node_modules -rw-r--r--@ 1 michaelhartman staff 42997 Nov 4 02:21 package-lock.json -rw-r--r--@ 1 michaelhartman staff 978 Nov 4 02:21 package.json -rw-r--r--@ 1 michaelhartman staff 631 Nov 3 22:11 server.js -rw-r--r--@ 1 michaelhartman staff 3172 Nov 4 02:16 test.js drwxr-xr-x@ 12 michaelhartman staff 384 Nov 4 02:15 testData drwxr-xr-x@ 5 michaelhartman staff 160 Nov 4 01:30 testDirectory -rw-r--r--@ 1 michaelhartman staff 1166382 Nov 4 02:18 testLog.txt drwxr-xr-x@ 87 michaelhartman staff 2784 Nov 4 01:39 utilities drwxr-xr-x@ 69 michaelhartman staff 2208 Nov 4 01:44 utilityTests michaelhartman@Michaels-MacBook-Pro cando-util %