How to find NPM package on Unpkg
Asked Answered
S

2

14

I'm trying to include an unpkg link to a particular NPM package 'Angular Calendar' in my system.config.js file so I can run my site on a server without building every time.

I don't know how to find the link. The system.config.js file on the example site of the NPM package shows it referencing npm, which to me means locally. I've tried that and it didnt work.

 'angular-calendar': 'npm:[email protected]/dist/umd/angular-calendar.js',

I just get an error saying error loading ... as "angular-calendar"

Any ideas? Am I looking at the problem correctly? I'm trying to run my site on a server, without building. So I need to link to all the dependencies in system.config.js. I don't know how to link to third party packages. I understand that if it's an NPM package, there is an unpgk link. I just don't know how to find it.

Thanks

Squiggle answered 21/11, 2017 at 13:55 Comment(1)
unpkg doesn't have any directory, listing, or search functionality at this point in time. However, all they do is wrap npm so you can explore and search for packages there and use the same name in unpkgSupra
E
23

There are some more docs on their homepage at https://unpkg.com

To get a specific version:

If I enter the url: https://unpkg.com/[email protected]
It would serve: https://unpkg.com/[email protected]/dist/umd/angular-calendar.js

To get the latest version:

If I enter the url: https://unpkg.com/angular-calendar
It would serve: https://unpkg.com/[email protected]/bundles/angular-calendar.umd.js

To browse the files in a package:

If you append a / to the url, it will list all the files in the package, ie.

https://unpkg.com/[email protected]/ will list all the files in that particular package.

Elmore answered 7/3, 2018 at 7:14 Comment(0)
B
4

There is no official way to search for UNPKG packages but there is a third part website https://unpkg.webutils.app/

You can search for packages and directly copy the unpkg link

Bossy answered 14/4, 2021 at 19:36 Comment(1)
@Prid It should be working nowBossy

© 2022 - 2024 — McMap. All rights reserved.