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

scuttle-tag

v0.5.0

Published

Tag reading and manipulation plugin for [secure scuttlebutt](https://github.com/ssbc/secure-scuttlebutt).

Downloads

13

Readme

scuttle-tag

Tag reading and manipulation plugin for secure scuttlebutt.

gives observables and async methods for getting and publishing tags on secure scuttlebutt.

Dependencies

ssb-backlinks must be installed in your server

Message Schema

{
  type: 'tag',
  tagged: true | false,
  message: %msg_id, // the message being tagged
  root: %tag_id, // unless this is original message for this tag
  branch: %tag_id | [%tag_id_a, %tag_id_b, ...] // only required if root present
}

Instantiate

var ScuttleTag = require('scuttle-tag')(server)

where server is a scuttlebutt server, ssb-client instance, or an observeable which will resolve to one of these!

API

tag.async.create({}, cb)

Creates a new tag message and calls cb when done.

tag.async.apply({ tag, message, tagged }, cb)

Creates a new tag message which applies the tag tag to the message message if tagged is true. (TODO: default tagged to true)

  • tag (required) - id of tag being applied
  • message (required) - id of message being tagged
  • tagged (required) - true if tag is being added, false if tag is being removed

tag.async.name({ tag, name }, cb)

Sets the name of a tag and calls cb when done.

  • tag (required) - id of tag being named
  • name (required) - name being applied to the tag

tag.obs.Tag(tagId, nameFn)

Returns a Mutant observable Struct which represents a tag. This struct holds the tagId and tagName. Takes an optional nameFn which returns an observable representing the tagName. If nameFn is not provided it will attempt to use the ssb-names plugin and if that is not available its short id will be used.

tag.obs.recent()

Returns a Mutant obserable list of most recently used tags

tag.obs.mostActive()

Returns a Mutant observable list of most actively used tags

tag.obs.messageTags(msgId)

Returns a Mutant observable list of tagIds which have been applied to the message msgId.

tag.obs.messageTagsFrom(msgId, author)

Returns a Mutant observable list of tagIds which have been applied to the message msgId by the specified author.

tag.obs.messageTaggers(msgId, tagId)

Returns a Mutant observable list of users which have applied tag tagId to the message msgId.

tag.obs.allTags()

Returns a Mutant observable array of all published tag messages visible to you.

tag.obs.allTagsFrom(author)

Returns a Mutant observable array of all tag messages published by an user.

tag.obs.messagesTaggedByWith(author, tagId)

Returns a Mutant observable array of ids of messages. This array is messages that have had the tag tagId applied by author.