@uni/caniuse
v1.0.7
Published
[](https://www.npmjs.com/package/@uni/caniuse)
Readme
canIUse
Determines whether the APIs, packages of the Univesal-api are available in the current version.
Support
Install
$ npm install @uni/caniuse --saveor
$ npm install @uni/apis --saveUsage
import canIUse from '@uni/caniuse';
// true
canIUse('storage');
// true
canIUse('storage.getStorage');
// false
canIUse('storage.getStorageInfo');
You can also import from the big package:
import {canIUse} from '@uni/apis';Methods
canIUse(options)
Arguments
| Property | Type | Description | Support | Default |
| --- | --- | --- | --- | --- |
| api | string | ${package}.${method} | ✔️ | - |
Returns
| Property | Type | Description |
| --- | --- | --- |
| res | boolean | the API can be used when return true |
