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

rescript-uuid

v9.0.1

Published

Rescript bindings for [uuid](https://www.npmjs.com/package/uuid)

Downloads

402

Readme

rescript-uuid

Rescript bindings for uuid

Install

yarn add uuid
yarn add -D rescript-uuid

Add it to your bsconfig.json

"bs-dependencies": [
    ...
    "rescript-uuid"
],

Example

let myNamespace = "1b671a64-40d5-491e-99b0-da01ff1f3341"

/**
 * Common functions
 */

let isValid = Uuid.validate(Uuid.V1.make())
let uuidParsed = Uuid.parse(Uuid.V1.make())
let uuidStringified = Uuid.stringify(uuidParsed)
let uuidVersion = Uuid.version(uuidStringified)

/**
 * UUID V1
 */
let uuidv1_1 = Uuid.V1.make()

let uuidv1_2 = Uuid.V1.makeWithOptions(~options=Uuid.V1.options(~clockseq=1, ()))

let uuidv1_3 = Uuid.V1.makeWithBuffer(
  ~options=Uuid.V1.options(~clockseq=1, ()),
  ~buffer=[1, 2, 3, 4],
  ~offset=0,
  (),
)

/**
 * UUID V3
 */
let uuidv3_DNS = Uuid.V3._DNS
let uuidv3_URL = Uuid.V3._URL

let uuidv3_1 = Uuid.V3.make(~name="google.com", ~namespace=#Uuid(myNamespace))
let uuidv3_2 = Uuid.V3.makeWithBuffer(
  ~name="google.com",
  ~namespace=#Uuid(myNamespace),
  ~buffer=[],
  ~offset=0,
  (),
)

/**
 * UUID V4
 */
let uuidv4_1 = Uuid.V4.make()
let uuidv4_2 = Uuid.V4.makeWithOptions(~options=Uuid.V4.options())
let uuidv4_3 = Uuid.V4.makeWithBuffer(~options=Uuid.V4.options(), ~buffer=[], ~offset=0, ())

/**
 * UUID V5
 */

let uuidv5_DNS = Uuid.V5._DNS
let uuidv5_URL = Uuid.V5._URL

let uuidv5_1 = Uuid.V5.make(~name="google.com", ~namespace=#Uuid(myNamespace))
let uuidv5_2 = Uuid.V5.makeWithBuffer(
  ~name="google.com",
  ~namespace=#Uuid(myNamespace),
  ~buffer=[],
  ~offset=0,
  (),
)