Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdurrahmanekr/cdn-on-gitserver
CDN on Git Server
https://github.com/abdurrahmanekr/cdn-on-gitserver
Last synced: 3 months ago
JSON representation
CDN on Git Server
- Host: GitHub
- URL: https://github.com/abdurrahmanekr/cdn-on-gitserver
- Owner: abdurrahmanekr
- Created: 2019-07-23T16:10:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T16:53:15.000Z (about 2 years ago)
- Last Synced: 2024-09-16T19:23:34.151Z (4 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CDN on Git Server
A library that can be used to store and manage files on a git server (GitHub, GitLab etc.)
# Install
```
npm i cdn-on-gitserver --save
```or
```
yarn add cdn-on-gitserver
```# Using
```javascript
const CDNOnGitServer = require('cdn-on-gitserver');const GitCDN = new CDNOnGitServer({
libName: 'gitlab',
auth: '',
libOptions: {
projectId: '12345678'
}
});/* set cdn file
* * * * * *
* Response
* @status: boolean, ex: true
*/
GitCDN.set({
fileName: 'file.txt', // required
content: Buffer.from('lorem ipsum'), // required
branch: 'master', // optional, default master
message: 'file.txt added', // optional, default ${fileName} file added.
authorName: 'Examle User', // optional
authorEmail: '[email protected]', // optional
})
.then(status => console.log);/* get cdn file
* @data: Buffer
*/
GitCDN.get('file.txt')
.then(data => console.log(data));```