Socket
Book a DemoInstallSign in
Socket

issue-db

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

issue-db

Use GitHub Issues as a JSON datastore

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

issue-db

☁️ Use GitHub Issues as a JSON datastore

Installation

npm install issue-db --save

Usage

const db = require('issue-db')({
  owner: 'some',
  repo: 'repo',
  token: process.env.GH_TOKEN
})

API

All methods are async.

  • db.put(object)
  • db.get(number)
  • db.list()
  • db.purge()

db.put(object)

  • object - Any JSON-serializable input, like a String, Number, or Object.

Returns an object with the following properties:

  • number - The id of the generate GitHub issue.
  • title - The title of the issue. If object has a any of the following properties, they'll be used as the title: title, name, or id. Otherwise, the default title is untitled
  • body - Your input object.

db.get(number)

Retrieve a record from the database.

  • number Number - A GitHub issue id.

Returns an object with the following properties:

  • number - The unique id of the generated GitHub issue.
  • title - The title of the issue. If object has a any of the following properties, they'll be used as the title: title, name, or id. Otherwise, the default title is untitled
  • body - Your input object.

db.list()

Returns an array of every record with a state of open

db.purge()

Sets the state of all open issues to closed, effectively deleting the contents of your entire database. Use with caution!

Tests

npm install
npm test

Dependencies

  • @octokit/rest: GitHub REST API client for Node.js
  • ellipsize: Ellipsizes a string at the nearest whitespace character near the end of allowed length

Dev Dependencies

  • dotenv-safe: Load environment variables from .env and ensure they are defined
  • jest: Delightful JavaScript Testing.
  • make-promises-safe: Crash or abort if you get an unhandledRejection
  • standard: JavaScript Standard Style
  • standard-markdown: Test your Markdown files for Standard JavaScript Style™

License

MIT

FAQs

Package last updated on 25 Mar 2018

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