开发者社区> 镜像站> NPM> patchcore
patchcore
minimal core for ssb clients
Last updated a year ago by mixmix .
AGPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install patchcore 
SYNC missed versions from official npm registry.

patchcore

a shared library to build ssb apps

or the shared assumptions of all (or most) ssb related applications

required sbot plugins

apps

here's a list of apps in the wild using patchcore:

plugins

here's a list of plugins that build on top of patchcore:

depject

to use this you must understand depject but also the historical context - depject is short for ~dependency injection" it was intended to make software that was very easy to add features to, but this didn't really work out. And most of the applications built on it embrace "strong opinions" but still happen to use depject, which is now inconvienient to change, because it's used throughout the entire app.

directory structure

the patchcore files are organized in the following hierarchy:

${topic} / ${type} / ${module}.js

or when module name is different from file name (this only happens within message/html):

${topic} / ${type} / ${module} / ${file}.js

some cases, the module is skipped (in topics: about, contact, backlinks, feed)

${topic} / ${type}.js

and, (only in backlinks/obs topic/type) the type and module are part of the same name.

{$topic=backlinks} / ${type=obs}-$name}

finally, the config, emoji, keys, and sbot topics types. it's just a single javascript.

${topic}.js

topics

  • lib (junk that isn't part of any topic and should really be published as a reusable module, but too lazy)
  • about - functions relating to about messages, for setting avatars and names.
  • blob - related to images and files
  • config - config.sync.load method that loads config.
  • contact - related to contact messages, for following and blocking.
  • emoji - :dancer: :tada: :joy_cat: :haircut_woman:
  • [feed](./docs/index.md#feed - stuff related to feeds - aka streams of messages by one or more user
  • invite - using invite codes
  • keys - load the main identity
  • message - relating to messages generically, i.e. publishing messages or rendering things that are the same for multiple different message types.
  • router
  • sbot

types

  • sync a function that returns an ordinary javascript value, such as a string or number. Usually a simple utility function.
  • async a function that takes a callback, and does IO. It may query the database or publish a message.
  • pull returns pull-stream source, sink, or through. Sometimes pull type returns a function that then creates a pull stream.
  • obs sometimes, return a mutant observable this is generally for things that change in real time or may load slowly, and you usually want to display them as a single thing (i.e. number of likes, or an avatar name). sometimes obs really just wrap async methods, but obs play more nicely with mutant than async functions do, other times obs functions directly expose a obs, or expose a function that you pass the listener to.
  • html returns an HtmlElement this may have dynamic behaviour.

license

AGPL-3.0

Current Tags

  • 2.2.0                                ...           latest (a year ago)

108 Versions

  • 2.2.0                                ...           a year ago
  • 2.1.7                                ...           a year ago
  • 2.1.6                                ...           2 years ago
  • 2.1.4                                ...           2 years ago
  • 2.1.3                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.28.3                                ...           2 years ago
  • 1.28.2                                ...           2 years ago
  • 1.28.1                                ...           2 years ago
  • 1.28.0                                ...           2 years ago
  • 1.27.2                                ...           2 years ago
  • 1.27.1                                ...           3 years ago
  • 1.27.0                                ...           3 years ago
  • 1.26.1                                ...           3 years ago
  • 1.26.0                                ...           3 years ago
  • 1.25.0                                ...           3 years ago
  • 1.24.1                                ...           3 years ago
  • 1.24.0                                ...           3 years ago
  • 1.23.6                                ...           3 years ago
  • 1.23.5                                ...           3 years ago
  • 1.23.4                                ...           3 years ago
  • 1.23.3                                ...           3 years ago
  • 1.23.2                                ...           3 years ago
  • 1.23.1                                ...           3 years ago
  • 1.23.0                                ...           3 years ago
  • 1.22.3                                ...           3 years ago
  • 1.22.2                                ...           3 years ago
  • 1.22.1                                ...           3 years ago
  • 1.22.0                                ...           3 years ago
  • 1.21.0                                ...           3 years ago
  • 1.20.1                                ...           3 years ago
  • 1.20.0                                ...           3 years ago
  • 1.19.0                                ...           3 years ago
  • 1.18.0                                ...           3 years ago
  • 1.17.0                                ...           3 years ago
  • 1.16.0                                ...           3 years ago
  • 1.15.1                                ...           3 years ago
  • 1.15.0                                ...           3 years ago
  • 1.14.0                                ...           3 years ago
  • 1.13.2                                ...           3 years ago
  • 1.13.1                                ...           3 years ago
  • 1.13.0                                ...           3 years ago
  • 1.12.1                                ...           3 years ago
  • 1.12.0                                ...           3 years ago
  • 1.11.0                                ...           3 years ago
  • 1.10.3                                ...           3 years ago
  • 1.10.2                                ...           3 years ago
  • 1.10.1                                ...           3 years ago
  • 1.10.0                                ...           3 years ago
  • 1.9.1                                ...           3 years ago
  • 1.9.0                                ...           3 years ago
  • 1.8.2                                ...           3 years ago
  • 1.8.1                                ...           3 years ago
  • 1.8.0                                ...           3 years ago
  • 1.7.2                                ...           3 years ago
  • 1.7.1                                ...           3 years ago
  • 1.7.0                                ...           3 years ago
  • 1.6.3                                ...           3 years ago
  • 1.6.2                                ...           3 years ago
  • 1.6.1                                ...           3 years ago
  • 1.6.0                                ...           3 years ago
  • 1.5.4                                ...           3 years ago
  • 1.5.3                                ...           3 years ago
  • 1.5.2                                ...           3 years ago
  • 1.5.1                                ...           3 years ago
  • 1.5.0                                ...           3 years ago
  • 1.4.3                                ...           3 years ago
  • 1.4.2                                ...           3 years ago
  • 1.4.1                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.1                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.8.0                                ...           3 years ago
  • 0.7.0                                ...           4 years ago
  • 0.6.0                                ...           4 years ago
  • 0.5.2                                ...           4 years ago
  • 0.5.1                                ...           4 years ago
  • 0.5.0                                ...           4 years ago
  • 0.4.12                                ...           4 years ago
  • 0.4.11                                ...           4 years ago
  • 0.4.10                                ...           4 years ago
  • 0.4.9                                ...           4 years ago
  • 0.4.8                                ...           4 years ago
  • 0.4.7                                ...           4 years ago
  • 0.4.6                                ...           4 years ago
  • 0.4.5                                ...           4 years ago
  • 0.4.4                                ...           4 years ago
  • 0.4.3                                ...           4 years ago
  • 0.4.2                                ...           4 years ago
  • 0.4.1                                ...           4 years ago
  • 0.4.0                                ...           4 years ago
  • 0.3.5                                ...           4 years ago
  • 0.3.4                                ...           4 years ago
  • 0.3.3                                ...           4 years ago
  • 0.3.2                                ...           4 years ago
  • 0.3.1                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 1
Last Month 1
Dependencies (30)
Dev Dependencies (4)