An open API service indexing awesome lists of open source software.

https://github.com/anshsinghsonkhia/generate-cdn

Generate CDN links from GitHub & unpkg (open-source) URLs
https://github.com/anshsinghsonkhia/generate-cdn

Last synced: 8 months ago
JSON representation

Generate CDN links from GitHub & unpkg (open-source) URLs

Awesome Lists containing this project

README

          

# generate-cdn
Generate CDN links from GitHub & unpkg (open-source) URLs


# Installation

```shell
npm i generate-cdn
```

# Usage

```js
const { githubCDN, unpkgCDN } = require('generate-cdn');
```

### Generate CDN Link from `GitHub` URL

```js
const githubUrl = 'https://github.com/AnshSinghSonkhia/thousand-colors/blob/main/index.js';
const cdnLink = githubCDN(githubUrl);
console.log(cdnLink);
```

### Generate CDN Link from `unpkg` URL

```js
const unpkgUrl = 'https://unpkg.com/boxicons@2.1.4/dist/boxicons.js';
const cdnLink2 = unpkgCDN(unpkgUrl);
console.log(cdnLink2);
```