GithubHelp home page GithubHelp logo

getcdn's Introduction

getcdn

Save the cdn file completely locally.

why do you need it

Because the cdn may be unstable, or it needs to be deployed in an intranet environment. At this time we need to download the cdn file to the local.

Suppose you use such a cdn file:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.css">

Then you downloaded it directly through the browser and saved it as bootstrap.css , and then referenced the file you just downloaded in the project, which seems to be fine, but there are actually many hidden dangers:

  • When bootstrap.css runs a certain function, it needs to depend on ./bootstrap.font, because you didn't know it before, so you didn't download it, which caused an error (the related dependencies were not downloaded).
  • During use, you find a problem and need to consult the bootstrap documentation, but you don't know what version to check (some libraries do not mark their own version number in the file).
  • When you need to switch back to the third-party CDN again, you will find how happy it is if you only need to change one origin (full mirror URL).
  • the url you want to trace to its github, its other versions, and more information about it...

how to use

Command Line:

# install
npm i -g getcdn

# help
getcdn .help

# download the latest version
getcdn userkey

# Specify the storage directory
getcdn .dir=mycdn userkey

# Download the specified version
getcdn [email protected]

# Specify namespace and version
getcdn @wll8/[email protected]

License

MIT

Copyright (c) 2017-present, xw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.