# vk-api-util **Repository Path**: mirrors_dsblv/vk-api-util ## Basic Information - **Project Name**: vk-api-util - **Description**: Utility methods for working with VK API - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-02-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vk-api-util [![Build Status](https://travis-ci.org/dsblv/vk-api-util.svg?branch=master)](https://travis-ci.org/dsblv/vk-api-util) > Utility methods for working with [VK API](http://vk.com/dev/main) ## Install ``` $ npm install --save vk-api-util ``` ## Usage ```js 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](http://vk.com/dev/methods). #### 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](http://vk.com/dev/permissions) for given scope. #### scope *Required* Type: `string`, `array` or `number` Pass a string of [scopes](http://vk.com/dev/permissions) 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. ```js 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` ## Related - [vk-api-all-methods](https://github.com/dsblv/vk-api-all-methods) — List of all VK API methods - [vk-api-open-methods](https://github.com/dsblv/vk-api-open-methods) — List of VK API methods that don't require authentication - [vk-api-scoped-methods](https://github.com/dsblv/vk-api-scoped-methods) — Hash of VK API methods that require correct scope and scopes they require - [vk-api-scopes](https://github.com/dsblv/vk-api-scopes) — Hash of VK API access permission codes ## License MIT © [Dmitriy Sobolev](http://vk.com/sobo13v)