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
- Host: GitHub
- URL: https://github.com/anshsinghsonkhia/generate-cdn
- Owner: AnshSinghSonkhia
- License: apache-2.0
- Created: 2024-03-08T07:36:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-08T13:10:19.000Z (over 1 year ago)
- Last Synced: 2025-02-01T02:18:02.656Z (8 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/generate-cdn
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```