
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Simply get raw files of github repository
$ npm install gh-raw
if you want to get file of github repository
const ghRaw = require('gh-raw')
ghRaw.get('/data/text.md', {
blob: 'master', // branch name
repository: 'zeakd/gh-raw',
}).then(res => {
console.log(res)
/*
---
title: sample text
---
# text
This is sample text
This is another text
*/
}).catch(error => {
console.error(error);
})
you can also get file from past commit
const ghRaw = require('gh-raw')
ghRaw.get('/data/text.md', {
blob: '9f311db2f4d5032252351806778306dfba1f4be4', // full commit hash
repository: 'zeakd/gh-raw',
}).then(res => {
console.log(res)
/*
---
title: sample text
---
# text
This is sample text
*/
})
it use https://raw.githubusercontent.com/
options
is required without extend
because repository
should be specified.
ghRaw.get('/data/text.md', {
repository: 'zeakd/gh-raw',
})
// specific branch
ghRaw.get('/data/text.md', {
repository: 'zeakd/gh-raw',
blob: 'samples'
// or you can use alias
// branch: 'samples'
})
// specific commit
ghRaw.get('/data/text.md', {
repository: 'zeakd/gh-raw',
blob: '9f311db2f4d5032252351806778306dfba1f4be4'
// or you can use alias
// commit: '9f311db2f4d5032252351806778306dfba1f4be4'
})
ghRaw is extendable. it would be convenient to extend with reposotory
option.
const rawRepo = ghRaw.extend({
repository: 'zeakd/gh-raw',
})
rawRepo.get('data/text.md')
const sampleRepo = rawRepo.extend({
blob: 'samples',
})
sampleRepo.get('data/text.md')
{
repository: 'zeakd/gh-raw' // default: undefined,
blob: 'master' // default: 'master'. alias : ['branch', 'commit']
}
FAQs
Simply get raw files for github repository
We found that gh-raw demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.