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

tango-es6-guid-generator

v1.0.1

Published

Simple ES6 JavaScript GUID Generator

Readme

tango-es6-guid-generator

A lightweight, dependency-free RFC4122 v4 GUID generator for Node.js projects built using ES6 modules.

tango-es6-guid-generator provides a small API for generating cryptographically secure GUIDs, along with helper functions for validation and testing.


✨ Features

  • RFC4122 v4 compliant GUID generation
  • Cryptographically secure randomness using Node’s built-in crypto module
  • ES6 module support
    • Clean import syntax
    • No CommonJS boilerplate
  • Zero runtime dependencies
  • Public validation helpers for testing and consumer use

📦 Installation

npm install tango-es6-guid-generator

🚀 Quick Start

import {
  generateGuid,
  generateEmptyGuid,
  isGuidV4,
  isEmptyGuid
} from 'tango-es6-guid-generator';

const generatedGuid = generateGuid();

console.log(generatedGuid);            // e.g. "3f9c2a1e-6d7e-4b6a-9c3a-8d1e2f4a9b7c"
console.log(isGuidV4(generatedGuid));  // true

🧪 Examples

Example 1 — Generate a GUID

const generatedGuid = generateGuid();

// Always returns a valid, non-empty RFC4122 v4 GUID

Example 2 — Generate Empty GUID

const emptyGuid = generateEmptyGuid();

console.log(emptyGuid);
// "00000000-0000-0000-0000-000000000000"

The empty GUID is provided as an explicit value and is never returned by generateGuid().


Example 3 — Helpers

isGuidV4('not-a-guid');               // false
isGuidV4(generateGuid());             // true
isEmptyGuid(generateEmptyGuid());     // true
isEmptyGuid(generateGuid());          // false

These helpers are useful for:

  • testing
  • input validation

📚 Public API

tango-es6-guid-generator exposes four functions.

generateGuid()

const generatedGuid = generateGuid();
  • Returns a cryptographically secure RFC4122 v4 GUID
  • Always returns a non-empty value
  • Never returns the empty GUID

generateEmptyGuid()

const emptyGuid = generateEmptyGuid();
  • Returns the all-zero GUID:
    00000000-0000-0000-0000-000000000000

isGuidV4(value)

isGuidV4(value);
  • Returns true if value is a valid RFC4122 v4 GUID
  • Returns false otherwise

isEmptyGuid(value)

isEmptyGuid(value);
  • Returns true if value equals the empty GUID
  • Returns false otherwise

🧠 Implementation Notes

  • This module targets Node.js
  • Randomness is sourced from Node’s built-in crypto.randomBytes
  • No browser or Web Crypto support is included by design

🎯 Design Philosophy

tango-es6-guid-generator is intentionally minimal.

  • Small, explicit API
  • No configuration
  • No mutable global state
  • No external dependencies
  • Predictable behavior
  • Easy to test and reason about