0.1.0 • Published 4 years ago

@apidog/vk-client v0.1.0

Weekly downloads
4
License
GPL-3.0
Repository
github
Last release
4 years ago

APIdog Mini VK Client for Node

Using

Install:

npm i @apidog/vk-client

Import:

import VK from '@apidog/vk-client';

Create instance of client:

const vk = new VK('abcdef0123456');

Make request:

const [durov] = await vk.perform<IUser[]>('users.get', {
    userIds: 1,
    fields: ['photo_50', 'first_name_dat'],
    // 'userIds' converts to 'user_ids'
    // arrays in value converts to comma-separated string
});

// or
vk.perform<IUser[]>('users.get', {
    userIds: [1],
}).then(([durov]) => {
    // ...
});