Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
vk-fast-longpoll
Advanced tools
RU | Мощный инструмент для работы с VK API, который работает в 25 раз быстрее обычных вызовов API методов.
EN | Powerfull tool for VK api that works 25 times faster then usual api calls
npm install vk-fast-longpoll --save
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
//Отвечаем на сообщение
}
});
Все методы VK должны вызываться с префиксом api например
group.api.messages.send({user_id: 1, message: 'Привет, Паша'});
Методы возвращают Promise-ы, поэтому стоит добавлять обработчик ошибок к каждому вызову.
group.api.messages.send({user_id: 1, message: 'Привет, Паша'}).catch(console.error);
Все названия методов, а также названия полей полностью соответсвуют названиям из документации VK
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
group.api.messages.send({user_id: message.sender, message: message.text}).then(() => {
console.log(message.text);
}).catch(console.error);
}
});
//В разработке
npm install vk-fast-longpoll --save
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
//Reply message
}
});
All VK Api methods must be called with api
prefix
group.api.messages.send({user_id: 1, message: 'Hello, Pasha'});
All methods return Promises, therefor you need to catch errors in every api call.
group.api.messages.send({user_id: 1, message: 'Hello, Pasha'}).catch(console.error);
All methods names and fields names are equal as VK Api docs
const VK = require('vk-fast-longpoll');
const group = new VK('token here');
group.longpoll.start();
group.longpoll.on('message', (message) => {
if(!message.isOutbox)
{
group.api.messages.send({user_id: message.sender, message: message.text}).then(() => {
console.log(message.text);
}).catch(console.error);
}
});
//In development
FAQs
VK Lib for better performance
We found that vk-fast-longpoll 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.