gitorm
A simple ORM to use your Github Repositories as a Database and a Data Bucket with Node.js
Features
- Make CRUD requests on files of your Github Repository
- Use your Github Repository as a Data Bucket
Installing
$ npm install gitorm
Getting started
gitorm(config)
To use Gitorm, you'll need to generate a token with repo and user scopes on Github Developer Settings.
// Creating a connection const Gitorm = token: 'generated-token' repository: 'repo-name' owner: 'repo-owner' await Gitormconsole
gitorm.find(options)
// Finding a fileconst fileName = 'index.txt'const file = await Gitorm
gitorm.findAll(options)
// Finding all files on a directoryconst file = await Gitorm
gitorm.create(options)
// Creating a fileconst fileName = 'index.json'const fileData = test: 123 const file = await Gitorm
gitorm.update(options)
// Updating a fileconst fileName = 'index.json'const updatedData = test: 123 const updatedFile = await Gitorm
gitorm.delete(options)
// Deleting a fileconst fileName = 'index.json'const file = await Gitorm