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

uuaf

v1.0.0

Published

Universally unique animal formulas

Downloads

2

Readme

UUAF

Universally Unique Animal Formulas

I wonder how things work on different planets...

Installation and basic usage

npm install uuaf --save
import { uuaf } from "uuaf";

console.log(uuaf());
// Formula 7e4486e0: chicken Sarah + ram Stephanie = macaw Alexandria (planet 0d7f4796cfe7 only)

Main goals

Features

  • based on uuid npm library, but it can work with plain strings as well
  • functions for direct UUAF generation supporting different UUID versions underneath
  • functions for translating from UUID to UUAF and vice versa
  • UUAF comes in two basic forms - short and long
  • typescript support

Examples

Formula 7e4486e0: chicken Sarah + ram Stephanie = macaw Alexandria (planet 0d7f4796cfe7)
7e4486e0-chicken-Sarah-ram-Stephanie-macaw-Alexandria-0d7f4796cfe7
7e4486e0-d6e0-11ea-8108-0d7f4796cfe7
Formula 2692d4db: eel Kaitlyn + wasp Victor = badger Tiffany (planet 74fc56355e46 only)
2692d4db-eel-Kaitlyn-wasp-Victor-badger-Tiffany-74fc56355e46
2692d4db-0889-39f9-90f0-74fc56355e46
Formula 3a7c1b89: ferret Raymond + kite Jesus = mantis Miguel (planet 621fb5d309d2 only)
3a7c1b89-ferret-Raymond-kite-Jesus-mantis-Miguel-621fb5d309d2
3a7c1b89-99d3-4177-a1bd-621fb5d309d2
Formula 952383ad: caribou Corey + vole Molly = bonobo Taylor (planet a00af9c2a3c3 only)
952383ad-caribou-Corey-vole-Molly-bonobo-Taylor-a00af9c2a3c3
952383ad-d340-50bf-b3ee-a00af9c2a3c3

API

uuaf

By default UUAF uses v4 version of UUID generation, but other options are availiable. Generator functions accepts input parameteres defined in uuid npm library plus additional parameter kind which can be set to short, long or raw

import { uuaf } from "uuaf";

// Generate UUAF based on UUID v4
console.log(uuaf());
console.log(uuaf({ kind: "short" }));

// Generate UUAF based on UUID v1
console.log(uuaf.v1({ kind: "long" }));

// Generate UUAF based on UUID v3
console.log(uuaf.v3("name", namespaceUuid));
console.log(uuaf.v3("name", namespaceUuid, "raw"));

// Generate UUAF based on UUID v4
console.log(uuaf.v4());

// Generate UUAF based on UUID v5
console.log(uuaf.v5("name", namespaceUuid));

fromUuid / toUuid

These two functions translate between UUID and UUAF

import { fromUuid, toUuid } from "uuaf";

const id = "952383ad-d340-50bf-b3ee-a00af9c2a3c3";
const uuaf = fromUuid(id);
console.log(uuaf);
// Formula 952383ad: caribou Corey + vole Molly = bonobo Taylor (planet a00af9c2a3c only)
const backToId = toUuid(uuaf);
console.log(id === backToId); // true

fromUuaf

This function is used to translate between different UUAF formats

import { fromUuaf } from "uuaf";

const uuaf =
  "Formula 3a7c1b89: ferret Raymond + kite Jesus = mantis Miguel (planet 621fb5d309d2 only)";

const shortUuaf = fromUuaf(uuaf, "short");
console.log(shortUuaf); // 3a7c1b89-ferret-Raymond-kite-Jesus-mantis-Miguel-621fb5d309d2