Socket
Socket
Sign inDemoInstall

vk-got

Package Overview
Dependencies
34
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vk-got

Convenience wrapper for `got` to interact with the VK API


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Install size
357 kB
Created
Weekly downloads
 

Readme

Source

vk-got Build Status

Convenience wrapper for got to interact with the VK API

Inspired by gh-got.

Install

$ npm install --save vk-got

Usage

const vkGot = require('vk-got');

vkGot('users.get', {
	body: {
		'userIds': 'sobo13v',
		'v': '5.37'
	}
}).then(res => {
	const dima = res.body.response[0];
	console.log(dima['first_name'] + ' ' + dima['last_name']);
});

API

vkGot(method, [options]) → promise

method

Required
Type: string

One of many VK API methods.

options

Basically same as got, except token, endpoint and body.

token

Type: string

VK access token.

Can be overridden globally with the VK_ACCESS_TOKEN environment variable.

endpoint

Type: string
Default: https://api.vk.com/method/

body

Type: object

Data to send with request. All keys are decamelized before being sent, so you can write them in camelCase!

vkGot.token([options]) → promise

Shorthand method for requesting access token.

Errors

vk-got extends got errors with one VK-specific error type.

vkGot.VKError

When you're lucky enough to catch one of VK errors.

Credits

vk-got is built ontop of got, a very useful module made by Sindre Sorhus and Vsevolod Strukchinsky – two real open-source gangsters. Shout out to them!

License

MIT © Dimzel Sobolev

Keywords

FAQs

Last updated on 19 Sep 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc