📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

vk-api-util

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vk-api-util

Utility methods for working with VK API

1.1.1
latest
Source
npm
Version published
Weekly downloads
9
80%
Maintainers
1
Weekly downloads
 
Created
Source

vk-api-util Build Status

Utility methods for working with VK API

Install

$ npm install --save vk-api-util

Usage

var vkUtil = require('vk-api-util');

vkUtil.bitMask(['friends', 'photos']);
//=> 6

API

vkUtil.isMethod(method) → boolean

Returns true if given metod is mentioned in VK API docs.

method

Required
Type: string

vkUtil.isOpenMethod(method) → boolean

Returns true if given method doesn't require authentication.

method

Required
Type: string

vkUtil.bitMask(scope) → number

Returns bit mask for given scope.

scope

Required
Type: string, array or number

Pass a string of scopes divided by comma (,) or array of scopes. If number is passed it assumed to be a bit mask itself and returned without changes.

vkUtil.checkScope(area, scope) → boolean

Returns true if given area is visible within given scope.

vkApiUtil.checkScope(['friends', 'video'], 4456466);
//=> true

area

Required
Type: string, array or number

scope

Required
Type: string, array or number

area and scope arguments are same as scope in aforementioned vkUtil.bitMask() method.

vkUtil.isMethodInScope(method, [scope]) → boolean

Returns true if given method is reachable within given scope.

method

Required
Type: string

scope

Type: string, array or number
Default: 0

  • vk-api-all-methods — List of all VK API methods
  • vk-api-open-methods — List of VK API methods that don't require authentication
  • vk-api-scoped-methods — Hash of VK API methods that require correct scope and scopes they require
  • vk-api-scopes — Hash of VK API access permission codes

License

MIT © Dmitriy Sobolev

Keywords

vk

FAQs

Package last updated on 07 Sep 2015

Did you know?

Socket

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