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.
@evo/chat-core
Advanced tools
Evo package, that controls all data mutations that are common for chat (message send, history, read counters etc), provides simple api and bunch of utils. It based on swindonJS library, that manages WS connection. All request/response formats are handling by Besida.
npm install --save -E @evo/chat-core
import { Swindon } from 'swindon';
import {
Besida,
BESIDA_ROLE_COMPANY
} from '@evo/chat-core';
import { Config } from './path/to/core/config';
const { KOMORA_URL } = Config.data.appState
const swindonObj = Swindon('/ws');
const besida = new Besida(swindonObj, BESIDA_ROLE_COMPANY, KOMORA_URL, IS_DEBUG);
besida.registerHandler('message', (topic, message) => action());
besida.registerHandler('error', (_, error) => action());
await besida.connect();
await besida.chatList();
Till that time, u will have besida.store
filled with chats data. Basicly store
is readonly propety,
dont try to change it, mutation will be cleared, after first interaction with ws
. One more thing about store, is that is in immutableJS
, so it's convenient to use with Redux
and similar rendering technologies. You can provide, mutableStore=true
, so it becomes plain js object, but it doesn't mean u can mutate it. Utils, works only with mutable store for now, will be improved with nearest minor version.
const currentChatRoom = besida.store.get(['chats']).first();
await besida.sendMessage(
currentChatRoom.get('room_ident'), msgBody, platfrom, source, device
);
Try - catch
block is unnesessary, all errors from Besida
will go in ur callback error function.
FAQs
core Besida module with base functional set for chat
The npm package @evo/chat-core receives a total of 4 weekly downloads. As such, @evo/chat-core popularity was classified as not popular.
We found that @evo/chat-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 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.