Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@cita/observables
Advanced tools
Observable based [CITA RPC](https://cryptape.github.io/cita/usage-guide/rpc/) toolkit
Observable based CITA RPC toolkit
$ yarn add @cita/observables
import CITAObservables from 'cita-observables'
const SERVER = 'localhost:1337'
const INTERVAL = 10
const RESERVED_RECORDS = 10
const citaObservables = new CITAObservables({
server: SERVER,
interval: INTERVAL,
reservedRecords: RESERVED_RECORDS,
})
/**
* @function peerCount
* @description subscribe to the count of peer
* @param {string} interval - interval of observable
* @param {boolean} observed - switch of observable, default to true, observing the peerCount
* @return {string} count - peer count
*/
citaObservables.peerCount(INTERVAL).subscribe(count => {
console.log(count)
})
/**
* @function newBlockNumber
* @description subscribe to the latest block number
* @param {string} interval - interval of observable
* @param {boolean} observed - switch of observable, default to true, observing the new block number
* @return {string} blockNumber - block number
*/
citaObservables.newBlockNumber(INTERVAL).subscribe(blockNumber => {
console.log(blockNumber)
})
/**
* @function blockByNumber
* @description request block by block number
* @param {string} blockNumber
* @return {object} block
*/
citaObservables.blockByNumber(blockNumber).subscribe(block => {
console.log(block)
})
/**
* @function newBlockByNumber
* @description subscribe to lastest block
* @param {string} interval - interval of observable
* @param {boolean} observed - switch of observable, default to true, observing the new block
* @return {object} block
*/
citaObservables.newBlockByNumber(INTERVAL).subscribe(block => {
console.log(block)
})
/**
* @function blockByHash
* @description request block by block hash
* @param {string} hash - block hash
* @return {object} block
*/
citaObservables.blockByHash(HASH).subscribe(block => {
console.log(block)
})
/**
* @function newBlockByNumberSubject
* @description subscribe to new block
*/
citaObservable.newBlockByNumberSubject.subscribe(console.log)
citaObservable.newBlockByNumberSubject.connect()
FAQs
Observable based [CITA RPC](https://cryptape.github.io/cita/usage-guide/rpc/) toolkit
The npm package @cita/observables receives a total of 11 weekly downloads. As such, @cita/observables popularity was classified as not popular.
We found that @cita/observables 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.