Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-database

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-database

Lightweight Cloud based JSON Database

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Installation

Because it's not in npmjs, you have to add this in package.json

{
   "dependencies": {
      "@neoxr/gitdb": "git+https://github.com/neoxr/gitdb",
   }
}

Get Token

You must have access to an authentication token to get it go to the https://github.com/settings/tokens page. Give a name for your token, set no expiration and follow the scope rules that need to be checked below to grant access and avoid errors.

  • repo
  • write:packages
  • delete:packages
  • admin:org
  • admin:public_key
  • admin:repo_hook
  • admin:org_hoox
  • gist
  • notifications
  • delete:repo
  • user
  • admin:enterprise
  • project
  • admin:rpg_key

Token format looks like this :

ghp_ZYuUPTSs3W4orj34g97iQRVrFWoswjwo

Authentication

Github authentication using this package as an example :

const config = {
   username: 'YOUR_USERNAME'
   repository: 'YOUR_REPOSITORY',
   file: 'FILENAME', // <-- JSON filename, If not passed defaults to : database
   token: 'YOUR_TOKEN'
}
const git = new(require('@neoxr/gitdb'))(config)

Fetch & Save JSON

There are main functions, namely .save() and .fetch()

1. Save
const data = {
   "name": "Budi Budiman",
   "age": 20,
   "hobby": "Turu"
}

git.save(data).then(res => {
   console.log(res)
})
2. Fetch
git.fetch().then(res => {
   console.log(res)
})

Example

Access the sample script here

Keywords

FAQs

Package last updated on 25 Jul 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc