Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
rho-cc-node-style-callback
Advanced tools
Create rho-contracts for Node-style callbacks.
You must use the Body Labs package, rho-contracts-fork
:
"dependencies": {
"rho-contracts-fork": "^1.3.0"
}
Use this module to create contracts for a Node-style callbacks. The returned contracts
accept functions whose first argument satisfies some error contract, and the other
arguments are specified the same way as c.fun
.
In the Node-style callback convention, any non-null non-undefined value for the first argument indicates an error. When an error is indicated, the other arguments must not be present, else a contract error is raised.
As a special case, invoking a callback with no arguments will invoke
the wrapped function with one argument set to undefined
.
Calling withError
on the returned contract changes the type of
the error argument to the contract specified.
The main entry point of this module is withDefaultError
, which sets
the expected error contract, like this:
var c = require('rho-contracts-fork');
var cc = {};
cc.callback = require('rho-cc-node-style-callback').withDefaultError(c.error)
cc.countCallback = cc.callback({ result: c.number })
npm install rho-contracts-fork rho-cc-node-style-callback
Pull requests welcome!
If you are having issues, please let us know.
The project is licensed under the Mozilla Public License Version 2.0.
FAQs
Create rho-contracts for Node-style callbacks
The npm package rho-cc-node-style-callback receives a total of 0 weekly downloads. As such, rho-cc-node-style-callback popularity was classified as not popular.
We found that rho-cc-node-style-callback demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.