# gitorm

> A simple ORM to use your Github Repositories as a Database and a Data Bucket with Node.js

Latest version **0.0.25** (published 2019-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install gitorm
pnpm add gitorm
yarn add gitorm
bun add gitorm
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.25 |
| Published | 2019-10-03 |
| First published | 2019-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 49.5 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | “Guilherme Bromonschenkel |
| Maintainers | guilhermebkel |
| Keywords | database, github, repository, orm, databucket |

## Links

- npm: https://www.npmjs.com/package/gitorm
- Repository: https://github.com/gbkel/gitorm
- Homepage: https://github.com/gbkel/gitorm#readme
- Issues: https://github.com/gbkel/gitorm/issues
- npm.io page: https://npm.io/package/gitorm

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.19.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.25 (latest) — 2019-10-03
- 0.0.24 — 2019-10-03
- 0.0.23 — 2019-10-03
- 0.0.22 — 2019-10-02
- 0.0.21 — 2019-10-02
- 0.0.20 — 2019-10-02
- 0.0.19 — 2019-10-02
- 0.0.18 — 2019-10-02
- 0.0.17 — 2019-10-02
- 0.0.16 — 2019-10-02
- 0.0.15 — 2019-10-02
- 0.0.14 — 2019-10-02
- 0.0.13 — 2019-10-02
- 0.0.12 — 2019-10-02
- 0.0.11 — 2019-10-02
- … 9 more at https://npm.io/package/gitorm/versions

## README

# gitorm

[![npm version](https://img.shields.io/npm/v/gitorm.svg?style=flat-square)](https://www.npmjs.org/package/gitorm)
[![install size](https://packagephobia.now.sh/badge?p=gitorm)](https://packagephobia.now.sh/result?p=gitorm)
[![npm downloads](https://img.shields.io/npm/dm/gitorm.svg?style=flat-square)](http://npm-stat.com/charts.html?package=gitorm)
[![CircleCI](https://circleci.com/gh/gbkel/gitorm/tree/master.svg?style=svg&circle-token=7bc6803f375b9f53b5dc1fd4e80739595caea83d)](https://circleci.com/gh/gbkel/gitorm/tree/master)

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

```bash
$ 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](https://github.com/settings/tokens).

```js
// Creating a connection
import gitorm from 'gitorm'

const Gitorm = new gitorm({
	token: 'generated-token',
	repository: 'repo-name',
	owner: 'repo-owner'
})

await Gitorm.connect()
console.log(Gitorm.status)
```

#### gitorm.find(options)

```js
// Finding a file
const fileName = 'index.txt'
const file = await Gitorm.find({
	path: `src/${fileName}`
})
```

#### gitorm.findAll(options)

```js
// Finding all files on a directory
const file = await Gitorm.findAll({
	path: 'src/'
})
```

#### gitorm.create(options)

```js
// Creating a file
const fileName = 'index.json'
const fileData = { test: 123 }
const file = await Gitorm.create({
	data: JSON.stringify(fileData),
	path: `src/${fileName}`
})
```

#### gitorm.update(options)

```js
// Updating a file
const fileName = 'index.json'
const updatedData = { test: 123 }
const updatedFile = await Gitorm.update({
	data: JSON.stringify(updatedData),
	path: `src/${fileName}`
})
```

#### gitorm.delete(options)

```js
// Deleting a file
const fileName = 'index.json'
const file = await Gitorm.delete({
	path: `src/${fileName}`
})
```

---
_Source: https://npm.io/package/gitorm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
