simplyhexagonal / short-unique-id

Short Unique ID (UUID) generation library. Available in NPM.

Home Page:https://www.npmjs.com/package/short-unique-id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The homepage Deno example fails to run

mybuddymichael opened this issue · comments

Attempting to run this simple example from the homepage fails:

import ShortUniqueId from 'https://cdn.jsdelivr.net/npm/short-unique-id@latest/src/index.ts';

const uid = new ShortUniqueId();

console.log(uid)

Deno complains:

error: An unsupported media type was attempted to be imported as a module.
  Specifier: https://cdn.jsdelivr.net/npm/short-unique-id@latest/package.json
  MediaType: Json

It appears that Deno does not yet support JSON modules.

I just instead used import ShortUniqueId from 'https://esm.sh/short-unique-id'; (per Deno's docs on imports) and that worked fine.

I've gone ahead and updated the docs on this and this other commit.

Also published a release in order to update npm and the website docs.

Cheers for the contribution @mybuddymichael 🚀