stereobooster / package.json

🗃️ package.json fields explained

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What about `cdn` entry?

VitorLuizC opened this issue · comments

Sometimes I see cdn entry, does it works for unpkg and jsdelivr ? Is there some standard about it?

I hear first time about it. Do you have example of npm package?

https://www.jsdelivr.com/features#publishing-packages

For packages hosted on npm, we support setting a "default" file for each package. This file is displayed at the top of directory listings on our website and available under shorter URL on the CDN. The default file can be configured by setting one of the following fields in package.json (ordered by priority):

jsdelivr
browser
main

https://unpkg.com/

If you omit the file path (i.e. use a "bare" URL), unpkg will serve the file specified by the unpkg field in package.json, or fall back to main.

https://github.com/cdnjs/cdnjs

no data

The only thing I can find is this bower/bower#19, but this is something else

I really don't known, but I'm guessing this is for some CDN service on China.

@egoist, can you tell us about this entry?

We support(ed) cdn at jsDelivr, in addition to jsdelivr, browser, and main fields. Initially we had this documented on our website and tried to make an agreement with unpkg to promote it together as a replacement for service-specific fields. Unpkg didn't agree so we went back to recommending a jsdelivr field. cdn still works though, for packages that use it.

@MartinKolarik thanks for insight