
Product
A New Overview in our Dashboard
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
cabal-core
Advanced tools
Core database, replication, and chat APIs for cabal.
npm install cabal-core
var Cabal = require('cabal-node')
Create a cabal p2p database using storage storage
, which must be either a
string (filepath to directory on disk) or an instance of
random-access-storage.
If this is a new database, key
can be omitted and will be generated.
Returns the local user's key (as a string).
Creates a new, live replication stream. This duplex stream can be piped into any transport expressed as a node stream (tcp, websockets, udp, utp, etc).
Retrieve a list of all channel names that exist in this cabal.
Emitted when a new channel is added to the cabal.
Returns a readable stream of messages (most recent first) from a channel.
Pass opts.limit
to set a maximum number of messages to read.
Calls fn
with every new message that arrives, regardless of channel.
Calls fn
with every new message that arrives in channel
.
Emitted when you connect to a peer. key
is a hex string of their public key.
Emitted when you lose a connection to a peer. key
is a hex string of their
public key.
Publish message
to your feed. message
must have a type
field set. If not,
it defaults to chat/text
. In general, a message is formatted as
{
type: 'text/chat',
content: {
text: 'hello world',
channel: 'cabal-dev'
}
}
A timestamp
field is set automatically with the current system time.
type
is an unrestricted field: you can make up new message types and clients
will happily ignore them until someone implements support for them. Well
documented types include
{
type: 'chat/text',
content: {
text: 'whatever the user wants to say',
channel: 'some channel name. if it didnt exist before, it does now!'
}
}
AGPLv3
[3.0.2] - 2018-09-05
There were several tags in between version 3.0.0
and 2.3.0
where @hackergrrl were developing on a separate branch while things were happening on master. Versions 2.3.1
, 3.0.0
and 3.0.1
never got published to npm. Major API rewrite.
cabal-node
to cabal-core
(@hackergrrl)kappa
instead of hyperdb
(@hackergrrl)cabal.getUser()
(@hackergrrl)cabal.publish()
(@hackergrrl)cabal.publishNick()
(@hackergrrl)cabal.getLocalKey()
(@hackergrrl)channels
, messages
and users
(@hackergrrl)cabal.onconnection()
(@hackergrrl)cabal.watch()
(@hackergrrl)cabal.getMessages()
(@hackergrrl)cabal.getChannels()
(@hackergrrl)cabal.joinChannel()
(@hackergrrl)cabal.leaveChannel()
(@hackergrrl)cabal.createReadStream()
(@hackergrrl)cabal.metadata()
(@hackergrrl)cabal.message()
(@hackergrrl)FAQs
p2p db functions for chat
We found that cabal-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.