Swap-Aggregator-Subgraph/node_modules/gluegun/docs/sniff.md
Richa-iitr d211083153 Revert "Revert "added handler""
This reverts commit c36ee8c5ca.
2022-07-03 07:30:05 +05:30

995 B

Sniff

The gluegun requires a Node 7.6.0 environment which provides async and await support natively.

You can safely check these requirements by using the sniff module.

const { ok } = require('gluegun/sniff')

if (ok) {
  // we are clear for lift-off
}

The ok property will be true if everything is good to go.

sniff also has a few more properties you can use for better errors.

property type value
ok bool true if everything is good to go
isNewEnough bool true if we have Node.js >= 7.6.0
hasAsyncAwait bool true if we have --harmony enabled
nodeVersion string the node version such as '7.6.0'
nodeMinimum string the node minimum that sniff is looking for

These two properties will both be set to true if we're running in Node 7.6.0.