How to Download something from unpkg.com
Asked Answered
J

3

6

Swiperjs has this link: https://unpkg.com/swiper/ to use their swiper locally. But how do I do download the content of this page?

I want the to have the content of this site locally. When I hit that link, I see the content of the package, but no download link. When I click save website in my browser, it downloads just some .js Files.

No, guys. Seriously. How do I do that?

I found this on that page: https://swiperjs.com/get-started

Johst answered 22/3, 2021 at 17:48 Comment(5)
The get started page appears to solve your problem? There's also an install from NPM page linked there.Baryta
@Baryta no, it does not. It says I can download it there. But how? There is no download link and my apporaches didn't work. I don't want to use npm, unless I can get exactly this package without node_modules and package.json generated.Johst
If you want the directory/file structure that you see on unpkg.com/swiper, you must use NPM. If you want the compiled JS for inclusion in HTML, those links are right at the top of the get started page in the first code block.Baryta
@Baryta well then they should the text on the site. "You can just watch but do nothing with this here" instead of "you can download them to use them locally"... I now went ahead and installed it with npm. Thank you very much.Johst
IMO the entire JS ecosystem is garbage, this unpkg thing is just one of many many many issues, so I feel your pain.Baryta
T
4

I know this question is old, but no one really helped you and I had exactly the same problem.

This worked:

  1. Go to the download page (eg: https://unpkg.com/browse/[email protected]/)
  2. Click on the file you want to download (eg https://unpkg.com/browse/[email protected]/swiper-bundle.css)
  3. Right click on the "View Raw"-Button and click save as

I don't know why but that took me ages to figure out.

Tegan answered 7/3, 2022 at 13:0 Comment(1)
Can you also provide steps to download the whole project directory?Childbearing
B
2

I also had this problem before, but I found an address that helped me a lot (this address : https://registery.npmjs.org/swiper/-/swiper-10.2.0.tgz) You should write package name instead swiper/ and swiper-------.tgz is the swiper version or package version I hope this answer can help you

Busiek answered 12/9, 2023 at 6:28 Comment(3)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewCurium
Very useful tip, I downloaded wapplyzer using this same method registry.npmjs.org/wappalyzer/-/wappalyzer-6.10.66.tgzLangelo
I got gridjs library using link: registry.npmjs.org/gridjs/-/gridjs-6.2.0.tgz . I assume that unpkg and npm are different services, but authors of popular libraries may be using both so it's worth to checkAdi
J
1
npm install swiper

Even though it says "you can directly download them from" it's actually means you can just watch what's in there. You can help yourself with npm install swiper. You get the same content as you see in the so called download link. Afterwards you can delete the package.json and move the folder out of the node_modules folder.

#falseAdvetising /rantoff

Johst answered 22/3, 2021 at 18:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.