rangoo94/bestest

View on GitHub
packages/detect-environment/lib/getOsPackage.ts

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Get native Node.js "OS" package,
 * or return null if it's not available in current environment.
 *
 * @returns {object|null}
 */
function getOsPackage () {
  try {
    return require('o' + 's')
  } catch (e) {
    return null
  }
}

export {
  getOsPackage
}