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-plugins

v1.0.4

Published

`ssb-plugins` is a plugin that provides additional plugin related functionality to a [secret-stack](https://github.com/ssbc/secret-stack) instance.

Downloads

298

Readme

ssb-plugins

ssb-plugins is a plugin that provides additional plugin related functionality to a secret-stack instance.

Without ssb-plugins, plugins can only be loaded explicitly by an ssb-server with the .use() method.

Generally speaking, this plugin provides the abilility for plugins to be loaded and run as a separate process, with communication over muxrpc.

There are 2 main ways that plugins can be enabled using ssb-plugins:

  1. loaded explicitly as part of the creation of a secret-stack instance
  2. loaded as a set of user configured plugins, defined in one's ssb config folder

Additionally, if enabling plugins from user-configuration, making use of .use(require('ssb-plugins')) explicitly will enable the CLI commands for users to install / uninstall / enable / disable plugins manually.

For explicit documentation of the CLI API, see here.

How to write plugins

See secret-stack/PLUGINS.md for how to create a plugin

Examples

var createSbot = require('secret-stack')()
.use(require('ssb-db'))

createSbot
  .use(require('ssb-plugins/load-user-plugins')()) //load user plugins from configuration. This may be used without the above!
  .use(require('ssb-plugins/load')(path, name))  //load an out of process plugin directly.
  .use(require('ssb-plugins'))  //provides install, uninstall, enable, disable. (optional)

In-line out of process plugins

Run a plugin as a separate process. The process is started by the parent process, and they communicate by running muxrpc over stdio. This means that plugins may now be written in a language other than javascript.

out of process plugins can be loaded manually. using require('ssb-plugins/load')(location, name)`

var Load = require('ssb-plugins/load')
createSbot
  .use(Load(path/to/plugin, 'plugin'))

Load user configured plugins

add all plugins defined in configuration.

createSbot
  .use(require('ssb-plugins/load-user-plugins'))

Plugins are configured as following: Normally this is created by sbot plugins.install <plugin-name> but it can also be installed manually.

  "plugins": {
    //load a javascript plugin, exposed as "plugin1"
    "ssb-plugin1: true,
    //load your own version of plugin2. note it is renamed to "plugin2"
    //so it is exposed as "plugin2" not "plugin2-forked"
    "ssb-plugin2-forked: "plugin2",
    "ssb-plugin2": {
      enabled: true,
      name, process
    }
  }

Installing a user configured ssb-plugin manually

cd ~/.ssb
npm install <plugin-name>
# open `./config` in your favorite editor
nano config
# set the config
"plugins": {
  "<plugin-name>": true
}
# or if it's an out of process plugin
"plugins": {
  "<plugin-name>": {
    "process": true,
    "name": ... //if it should be exposed with a different name...
  }
} 

License

MIT