Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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
The npm package vk-fast-longpoll receives a total of 3 weekly downloads. As such, vk-fast-longpoll popularity was classified as not popular.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.