☁️ Use GitHub Issues as a JSON datastore
npm install issue-db --save
const db = require('issue-db')({
owner: 'some',
repo: 'repo',
token: process.env.GH_TOKEN
})
All methods are async.
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. Ifobject
has a any of the following properties, they'll be used as the title:title
,name
, orid
. Otherwise, the default title isuntitled
body
- Your input object.
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. Ifobject
has a any of the following properties, they'll be used as the title:title
,name
, orid
. Otherwise, the default title isuntitled
body
- Your input object.
Returns an array of every record with a state
of open
Sets the state
of all open
issues to closed
, effectively deleting the
contents of your entire database. Use with caution!
npm install
npm test
- @octokit/rest: GitHub REST API client for Node.js
- ellipsize: Ellipsizes a string at the nearest whitespace character near the end of allowed length
- 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™
MIT