Uuid: Make use of unpkg.com instead of wzrd.in

Created on 1 Feb 2017  路  10Comments  路  Source: uuidjs/uuid

There is an option described in docs to use the package via wzrd.in.
I've just noticed that service responds with 502 code.

Will it be fine to make pull request to replace usage of wzrd.in with unpkg.com (ex-npmcdn)?

BTW, they seem to be fine with using their URLs in production so it might become recommended way to use uuid in browser.

help wanted

All 10 comments

Yup, looks like wzrd.in is down.

Unpkg looks like a pretty amateur effort. I don't mean that in a derogatory sense - only that it's one person's "best effort" solution, with no real SLA. Recommending that as a production-level solution seems optimistic. But I'm fine switching to that until someone recommends a better option.

Indeed, you are right, unpkg is not suited for production use as they clearly state on their website.

Unfortunately, there is another issue, which holds me back from making a pull request with suggested earlier edits: services like unpkg don't provide any ways to bundle CommonJS modules into components usable from browser out of the box (they don't bundle CommonJS into AMD or something and instead rely on package maintainers to provide npm package with prebuilt lib sources).

I checked issues and it seems that there is no goal to provide uuid npm package in a bundled state. Feel free to close this issue if I am right, otherwise I can take a look and try to make some prebulish npm script in order to make published npm packages consisting of bundled sources version as well.

I checked issues and it seems that there is no goal to provide uuid npm package in a bundled state. Feel free to close this issue if I am right

Correct, there is no desire to do this because packaged state means different things to different people.

The goal with putting wzrd.in on the readme was less about production and more to give folks a way to download a prebuilt version for use in their projects. If you aren't going to install and bundle this module with your deployment, then the next reliable thing is to copy the bundled code into your project and reference it from there.

sticking with wzrd.in for now.

Seems like https://cdnjs.com/ is the go-to resource for this sort of thing these days. Would love to switch over to that, but uuid doesn't seem to be a supported library yet. Anyone want to tackle that?

Note: Ideally users should be able to link directly to the version-specific file within the uuid module. E.g. https://cdnjs.cloudflare.com/ajax/libs/uuid/3.3.2/v4.js

Another alternative is www.jsdelivr.com which does tout "Built for production" since they use multiple CDN providers.

List of files from npm: https://cdn.jsdelivr.net/npm/uuid/

Direct link to a file: https://cdn.jsdelivr.net/npm/[email protected]/v4.js

They even have a badge with stats for your package

UPDATE: one thing to point out is that they don't do any conversion for CJS to UMD or ESM so you'll either need to publish a "compiled" file or the user must implement require in the browser.

I will handle this, give me a few moments to fork and submit a PR

See https://github.com/kelektiv/node-uuid/issues/302#issuecomment-524827935 for an alternative that works as of today (but may cease to work in the future just like wzrd.in since it also seems to be rather a pet project than a professional service that you should be relying on).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ORESoftware picture ORESoftware  路  5Comments

danactive picture danactive  路  3Comments

ctavan picture ctavan  路  7Comments

guybedford picture guybedford  路  9Comments

8bitjoey picture 8bitjoey  路  5Comments