npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ssb-issues

v1.0.0

Published

Issue tracking built on secure-scuttlebutt

Downloads

39

Readme

ssb-issues

Issue tracking built on secure-scuttlebutt

Schema

type: issue

An issue. Represents something that should be fixed.

{
  type: 'issue',
  project: Link?,
  title: string?,
  text: string?
}

issue edits

Edits to an issue may be done by any ssb message type. For example, you can make a post that updates an issue, or push a git commit that updates an issue. If the message does not have any content other than to update the issue, then the type may be issue-edit.

{
  type: 'issue-edit'|'post'|'git-update',
  issues: [{
	link: IssueRef,
	open: boolean,
  }]
}

API

var Issues = require('ssb-issues')
var issues = Issues.init(sbot)

get: async

Get an issue by its id

issues.get(issueId, cb)

The resulting issue object is as follows:

{
  id: MsgRef,
  author: FeedRef,
  project: Ref?,
  projectAuthor: FeedRef?,
  created_at: number, 
  updated_at: number,
  open: boolean,
  msg: Msg,
}
  • id: id of the issue
  • author: author of the issue
  • created_at (timestamp): when the issue was created
  • updated_at (timestamp): when the issue was last updated
  • title: title of the issue (deprecated)
  • open: whether the issue is open (true) or closed (false)
  • project: the project that the issue is for
  • projectAuthor: the author of the project
  • msg: ssb message object that created the issue (with .key and .value).

list: source

Get a stream of issues

issues.list({ project:, open:, author:, live:, gt:, gte:, lt:, lte:, reverse: })
  • project (Ref): get only issues for the given target
  • open (boolean): get only open or closed issues
  • author (FeedRef): get only issues from the given feed
  • live (boolean, default: false): Keep the stream open and emit new messages as they are received.
  • gt (greater than), gte (greater than or equal): maximum [timestamp, id]
  • lt (less than), lte (less than or equal): minimum [timestamp, id]
  • reverse (boolean, default: false): reverse the order of results

new: async

Create a new issue

issues.new({ project:, title:, text: }, cb)
  • project (Ref): id of an ssb object representing the target of the issue
  • title (string): title of the issue (deprecated)
  • text (string): text describing the issue

close: async

issues.close(id, cb)

Mark an issue as closed.

id (MsgRef): id of the issue to reopen

reopen: async

issues.reopen(id, cb)`

Mark an issue as open.

id (MsgRef): id of the issue to reopen text (string): text to accompany the open action

edit: async

issues.edit(id, opts, cb)`

Edit an issue.

id (MsgRef): id of the issue to reopen opts.open (boolean): set open/closed status opts.title (string): set title (deprecated)

isStatusChanged: sync

var open = issueSchemas.isStatusChanged(issue, msg)

Check if a message changes an issue's status

  • msg (Msg in metadata): message to check
  • issue (Issue): issue to check for update
  • open (boolean?): whether the message updates the issue to be open (true) closed (false), or does not affect it (null)

getMention: sync

var mention = issueSchemas.getMention(issue, msg)

Get a mention of an issue in a message, if any

  • msg (Msg in metadata): message to check
  • issue (Issue): issue to check for update
  • mention (object?): mention object, with properties like
    • mention.open (boolean?): whether the issue is updated to be open (true), closed (false), or not (null)

deinit: async

Deinit the issues object. Closes all live streams. Since issues uses live streams, you should call deinit when you are done with the issues and want your program to exit or free up resources.

pulls.deinit(cb)

schemas

var issueSchemas = Issues.schemas

issueSchemas.new(project, title, text)

Create a new issue.

  • project (Ref): id of project to associate the issue with
  • title (string): title to give the issue (deprecated)
  • text (string): text body for the issue

issueSchemas.edit(id, opts)

Edit an issue.

  • opts.open (boolean): open or close the issue
  • opts.title (string): set the title of the issue (deprecated)

issueSchemas.close(id)

Close an issue.

  • id (MsgRef): id of an issue to mark as closed

issueSchemas.reopen(id)

Reopen an issue.

  • id (MsgRef): id of an issue to mark as open

issueSchemas.closes(msg, id)

Mutate a message to make it close an issue

  • msg (Msg): message object to update
  • id (MsgRef): id of an issue to mark as closed

issueSchemas.reopens(msg, id)

Mutate a message to make it reopen an issue

  • msg (Msg): message object to update
  • id (MsgRef): id of an issue to mark as open

License

Copyright (c) 2016 Charles Lehner

Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.

DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.