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 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-cocona-net

v0.1.1

Published

A basic microservices module based on Cherry and cote.

Readme

cocona-net

A basic microservices module based on Cherry and cote.


Features:

  • Scopes
  • IDs
  • Groups
  • Versions
  • Update triggers
  • Encrypted data transfer

Installation:

To install the module:

yarn add node-cocona-net

Cherry is required to use cocona-net. You can get started with a new Cherry project by using Cherry-CLI.


Configuration:

await cherry.registerModule("node-cocona-net")
await cherry.createModule("node-cocona-net")
await cherry.loadModule("node-cocona-net", {
    loggingEnabled: true,
    conf: {
        id: "2qm7f4", //Default: name of current microservice package.json
        version: "0.0.1", //Default: version of current microservice package.json
        scope: "main", //Required: Scope of the used network
        key: "htpm5ezst5m5itj6", //Required: Encryption/Decryption key
        autoUpdate: true, //Default: true, should only be changed if really needed
    }
})

Documentation:

  • async createResponder
let module = await cherry.getModule("node-cocona-net")
let result = await module.createResponder(name, id = false, group = false, ignoreVersion = false)

Creates a new cote responder with given name, id and group. Only responder/requester with the same id and group can communicate with each other (Defaults to service id). Can ignore versions in the network (Only scope and group used). Returns true if successful.


  • async onResponder
let module = await cherry.getModule("node-cocona-net")
let result = await module.onResponder(name, event, func)

Example:
let result = await module.onResponder("TestResponder", "test", (data, cb) => {
    if(data.test === true)
        cb(true)
    else
        cb(false)
})

Creates a new cote responder event handler with given name and event type. Func gets called on every event with data and callback to send result back. Returns true if successful.


  • async createRequester
let module = await cherry.getModule("node-cocona-net")
let result = await module.createRequester(name, id = false, group = false, ignoreVersion = false)

Creates a new cote requester with given name, id and group. Only responder/requester with the same id and group can communicate with each other (Defaults to service id). Can ignore versions in the network (Only scope and group used). Returns true if successful.


  • async sendRequest
let module = await cherry.getModule("node-cocona-net")
let result = await module.sendRequest(name, event, alive, data, cb)

Example:
let result = await module.sendRequest("TestRequester", "test", 5000, {test: true}, (data) => {
    console.log(data)
})

Sends a new cote request with given name, event type, timeout in milliseconds and data. Callback gets called with result. Returns true if successful.


  • async createPublisher
let module = await cherry.getModule("node-cocona-net")
let result = await module.createPublisher(name, id = false, group = false, ignoreVersion = false)

Creates a new cote publisher with given name, id and group. Only publisher/subscriber with the same id and group can communicate with each other (Defaults to service id). Can ignore versions in the network (Only scope and group used). Returns true if successful.


  • async sendBroadcast
let module = await cherry.getModule("node-cocona-net")
let result = await module.sendBroadcast(name, event, data)

Example:
let result = await module.sendBroadcast("TestPublisher", "test", {test: true})

Sends a new broadcast via cote publisher with given name, event type and data. Returns true if successful.


  • async createSubscriber
let module = await cherry.getModule("node-cocona-net")
let result = await module.createSubscriber(name, id = false, group = false, ignoreVersion = false)

Creates a new cote subscriber with given name, id and group. Only publisher/subscriber with the same id and group can communicate with each other (Defaults to service id). Can ignore versions in the network (Only scope and group used). Returns true if successful.


  • async onBroadcast
let module = await cherry.getModule("node-cocona-net")
let result = await module.onBroadcast(name, event, func)

Example:
let result = await module.onBroadcast("TestPublisher", "test", (data) => {
    console.log(data)
})

Creates a broadcast event handler via cote subsriver with given name and event type. Func gets called on every event with data. Returns true if successful.


  • async onUpdateEvent
let module = await cherry.getModule("node-cocona-net")
let result = await module.onUpdateEvent(func)

Example:
let result = await module.onUpdateEvent(() => {
    console.log("Update")
})

Creates an update event handler (Using service id; cocona-net updates are global). Func gets called on every update event. Returns true if successful.


  • async onIdle
let module = await cherry.getModule("node-cocona-net")
let result = await module.onIdle(func)

Example:
let result = await module.onIdle(() => {
    console.log("Idle")
})

Creates an idle event handler. Func gets called anytime the application is idle (No requests being processed). Returns true if successful.


Contribution:

To run tests (incomplete):

yarn test

To start a test environment:

yarn start