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

@createdbyjurand/cloak

v1.0.0-SNAPSHOT

Published

@createdbyjurand/cloak

Readme

@createdbyjurand/cloak

Generate random strings containing lowercase letters, digits, and hyphens. Requires Node.js 26 or newer. Uses Node's cryptographic random number generator.

Install

npm i @createdbyjurand/cloak

Usage

import {generateCloak, generateCloaks} from '@createdbyjurand/cloak';

const cloak = generateCloak(); // One 9-character string, including hyphens.
const cloaks = generateCloaks(5); // An array of five strings.

const longer = generateCloak(36, 36, 3, 12);
const batch = generateCloaks(5, 36, 36, 3, 12);

console.log(cloaks.join('\n')); // Printing is up to you.

generateCloak(minLength = 9, maxLength = 9, minGap = 3, maxGap = 12)

  • Length includes hyphens. Both length limits are inclusive.
  • Every cloak has at least one hyphen, with no leading, trailing, or adjacent hyphens.
  • minGap and maxGap set the number of characters between hyphens.
  • The first and last segments contain between 1 and maxGap characters.
  • Lengths must be integers from 3 to 4096; gaps must be integers from 1 to 4096.
  • Minimums cannot exceed maximums. Invalid or impossible settings throw RangeError.
  • Only feasible lengths are chosen. For gaps of 1..1, these are odd lengths.

generateCloaks(count = 10, minLength = 9, maxLength = 9, minGap = 3, maxGap = 12)

Returns an array using the same settings. count must be an integer from 0 to 1000. A count of 0 returns an empty array without checking the cloak settings. The limits keep individual calls from requesting excessive work.

Generation builds each string directly, without enumerating layouts or retrying rejected strings. Hyphen layouts are not equally likely, and random strings are not guaranteed to be unique.

Importing the package does not print or generate anything.

Console display

import {consoleLogCloaks} from '@createdbyjurand/cloak';

consoleLogCloaks(); // Fill the terminal with aligned columns of 36-character cloaks.
consoleLogCloaks(5, 2, 12, 16, 3, 6); // Rows, spaces between columns, then length and gap settings.

Columns fit the terminal width, with at least one cloak per row. Shorter cloaks are padded so columns stay aligned. Without terminal dimensions, the display uses 80 columns and 24 rows. The total number of cloaks must not exceed 1000, matching generateCloaks.

Run directly from the repository root:

node cloak/src/console-log-cloaks.ts

License

ISC