Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njakob/scope-test
Simple util to test collections of granted scope against required one
https://github.com/njakob/scope-test
Last synced: 17 days ago
JSON representation
Simple util to test collections of granted scope against required one
- Host: GitHub
- URL: https://github.com/njakob/scope-test
- Owner: njakob
- License: mit
- Created: 2016-08-11T13:47:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-25T11:16:01.000Z (over 8 years ago)
- Last Synced: 2024-12-04T13:02:02.850Z (30 days ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scope-test
[![NPM version][npm-status-image]][npm]
Simple util to test collections of granted scope against required one.
## Features
* Isomorphic module
* Error with missing scopes
* Case insensitive option
* Flowtype definition## Installation
[![NPM][npm-install-image]][npm]
```
$ npm install scope-test
```## Usage
```javascript
import { scopeTest } from 'scope-test';try {
scopeTest([ 'email' ], {
requiredScopes: [ 'email', 'profile' ],
ignoreCase: true
});
} catch (err) {
console.log(err.missingScopes);
}
```## Licences
Scope-test is licensed under the [MIT License][licence].
[licence]: LICENSE
[npm]: https://nodei.co/npm/scope-test/
[npm-install-image]: https://nodei.co/npm/scope-test.png?downloads=true
[npm-status-image]: https://img.shields.io/npm/v/scope-test.svg