
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
node-cocona-net
Advanced tools
A basic microservices module based on Cherry and cote.
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.
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
}
})
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
To run tests (incomplete):
yarn test
To start a test environment:
yarn start
FAQs
A basic microservices module based on Cherry and cote.
We found that node-cocona-net demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.