![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
npm install lp-vk
Then, use require
:
const LP = require('lp-vk');
const lp = new LP({ token: '' }); // options
If you need, you can put
group_id
in options.
Also, callback is possible
const lp = new LP({ token: '', callback: { confirmation: '' } | true }); //if no code, will get own from API
All events are from vk API
lp.on('message_new', handler); //function with only argument
Handler's argument is event, or if message
, it is message's object
lp.start(options);
Will start polling and get group_id
if needed.
message.send(text, params);
message.is_chat //bool
message.chat_id //id
message.sendPhotos(raw, params); //filenames
message.sendPhotosBuffer(raw, params); //buffers
message.sendStoryBuffer(rew, params); //buffers
message.sendDocuments(raw, params); //filenames
message.sendAudioMessage(raw, params); //filenames
message.sendSticker(id, params);
message.replySticker(id, params);
message.reply(text, params);
message.forward(peer_id, params|text);
message.edit(conversation_message_id, params|text);
message.delete(id, params);
message.removeChatUser(member_id, params|chat_id);
message.getConversation(peer_ids, params);
message.sendMessageEventAnswer(ans); //see vk api docs
lp.api.method.do(params);
Execute mode is on
error.msg = 'Param is invalid or empty';
error.code = 100;
error.params = {} | null;
error.toString() = 'Error 100 - Param is empty or invalid';
FAQs
Simple vkontakte API longpoll/callback library
The npm package lp-vk receives a total of 12 weekly downloads. As such, lp-vk popularity was classified as not popular.
We found that lp-vk 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.