Registry / database / gitorm

gitorm

JSON →
library0.0.25jsnpmunverified

gitorm is a simple ORM (v0.0.25) that uses GitHub repositories as a database and data bucket for Node.js. It provides CRUD operations on files stored in a GitHub repo, treating the repository as a backend store. The package is minimal, with no external dependencies, and works with GitHub's REST API. It is suitable for small projects or prototyping where a full database is unnecessary. Last updated in 2021, it has low activity and is considered stable but not actively maintained.

npm install gitorm
INSTALL
IMPORT
SIG · GITORM
G
gitorm
databasejavascriptv0.0.25
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gitorm
import gitorm from 'gitorm'
import { gitorm } from 'gitorm'
The package exports a default class, so named import will not work.
gitorm
const gitorm = require('gitorm')
const { gitorm } = require('gitorm')
CommonJS require returns the default export as an object.
gitorm instance methods (connect, find, etc.)
await gitormInstance.connect()
Gitorm.connect()
Methods are instance methods, not static. Must create instance with 'new gitorm(config)'.

Connects to a GitHub repository using a token, then creates and reads a JSON file.

import gitorm from 'gitorm'; const config = { token: process.env.GITHUB_TOKEN ?? '', repository: 'my-repo', owner: 'my-username' }; async function main() { const db = new gitorm(config); await db.connect(); console.log('Status:', db.status); // Create a file await db.create({ data: JSON.stringify({ hello: 'world' }), path: 'data/test.json' }); // Find a file const file = await db.find({ path: 'data/test.json' }); console.log('File content:', file); } main().catch(console.error);
Debug
Known issues
gotchaThe package uses the GitHub REST API, which has rate limits (5000 requests/hour for authenticated users). Exceeding limits will cause errors.
fix
Implement retry logic or respect rate limits in your application.
affects: >=0.0.0
gotchaToken must have 'repo' and 'user' scopes. Missing scopes leads to 401/403 errors.
fix
Generate a token with required scopes at https://github.com/settings/tokens.
affects: >=0.0.0
gotchaFile operations are not transactional; concurrent writes may conflict. Gitorm does not handle merge conflicts.
fix
Use a queuing system or ensure single-writer access.
affects: >=0.0.0
gotchaData is stored as plain text in GitHub files; sensitive information is not encrypted. Anyone with repo access can read file content.
fix
Encrypt data before storing if you need confidentiality.
affects: >=0.0.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED
Network issues or GitHub API endpoint unreachable.
fix
Check your internet connection and ensure GitHub API is accessible.
HttpError: Bad credentials
Invalid or missing GitHub token.
fix
Generate a new token with 'repo' and 'user' scopes and set it in config.
TypeError: gitorm is not a constructor
Using named import instead of default import.
fix
Use 'import gitorm from 'gitorm'' or 'const gitorm = require('gitorm')'.
Error: Repository not found
Repository name or owner is incorrect, or token lacks access to the repo.
fix
Double-check repository and owner fields in config; ensure token has access.
Error: Not Found
File path does not exist in the repository.
fix
Verify the path exists or create it first using db.create() with path including necessary directories.
Upgrade
Version history
0.0.25latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
packagegitorm
gitorm — npm install gitorm · libregistry