
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
github-as-storage
Advanced tools
This package is an experimental to use github as a storage service similar to AWS S3.
This is helpful for developers who want to work on small projects and pay for storage of file, instead going for some cloud providers. We can use the power of github storage and use it as conventional storage system.
This package uses @octokit/rest a Github's rest API client.
If it doesn't work for you or you encounter any error. Please raise a issue with the details. GITHUB REPO
> Be careful while creating a personal access token, allow only relevant permissions.
Through npm install
npm install github-as-storage
Or in dependencies in package.json
dependencies: {
"github-as-storage": "1.0.0",
},
Import the package as below
const GithubStorageService = require('github-as-storage');
Each function need some parameters to be passed.
To perform these actions you need personal access token with access to that particular repo (to restrict access to other repos)
We are not storing the token for security concerns, so you need to pass it each and every time calling the below functions
Three functions implemented as of now:
Upload File:
await GithubStorageService.uploadFile(envParams, filePath, fileBuffer)
envParams :
{
accessToken: "Your Github Token",
owner: "Your username (case sensitive)",
repository: "Repository name",
branch: "branch name you want to store"
}
filePath: exact path where you wanna store like which folder and filename (/samples/test/sample.pdf)
It will store the sample.pdf inside test folder which is inside samples folder.
fileBuffer: buffer datatype of file you want to upload.
On successful upload: Will return the filepath where it is stored similar to s3Key.
status: 'success',
message: 'Image uploaded to GitHub repository successfully',
response: {
filePath,
},
Delete File:
await GithubStorageService.deleteFile(envParams, filePath)
envParams: same as above mentionedfilPath: exact file path of the file (/samples/test/sample.pdf) status: 'success',
message: 'File deleted from GitHub repository successfully.',
Get File URL: To get the url for the file you want to use it to render it wherever you want to preview.
await GithubStorageService.getUrl(envParams, filePath)
Any one can feel free to improve this package functionality. visit the repo: Github as storage
FAQs
Free storage using github
We found that github-as-storage 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.