vkapi-lite
![NPM](https://nodei.co/npm/vkapi-lite.png)
Lite VK API wrapper for Node.JS
Installation
npm install vkapi-lite
Usage
Calling Methods
const UserInstance = require('vkapi-lite');
const client = new UserInstance({
token: 'YOUR_TOKEN'
});
client.callMethod('users.get', {
user_ids: [1, 210700286],
fields: 'verified'
}).then((users) => {
console.log(users[0].first_name);
});
Or just...
client.callMethod('users.get').then(console.log);
Long Polling
client.on('addANewMessage', (message) => {
console.log(message);
client.stopPolling();
});
client.startPolling();
Debugging
client.logger = function log(action, methodOrServer, params) {
console.error(`[${new Date()}] ${action} ${methodOrServer} ${params}`);
};
client.debug = true;