sg-check
v1.1.5
Published
Checking utilify for SUGOS
Downloads
24
Readme
sg-check
Checking utilify for SUGOS
Installation
$ npm install sg-check --save
Usage
'use strict'
const { hasBin, hasVar } = require('sg-check')
const co = require('co')
co(function * () {
// Check a command available
{
let hasWhichCommand = yield hasBin('which')
/* ... */
}
// Check a variable available
{
let hasWindow = yield hasVar('window')
/* ... */
}
}).catch((err) => console.error(err))
Functions
Available functions
| Signature | Description |
| ---- | ----------- |
| .hasBin(binName) -> Promise.<boolean>
| Check if a bin available |
| .hasVar(varName) -> Promise.<boolean>
| Check if a variable available |
License
This software is released under the Apache-2.0 License.