How to use the os-name function in os-name

To help you get started, we’ve selected a few os-name examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / dev-spaces / actions / add-review-url / node_modules / @octokit / endpoint / node_modules / universal-user-agent / dist-src / node.js View on Github external
export function getUserAgent() {
    try {
        return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
    }
    catch (error) {
        if (/wmic os get Caption/.test(error.message)) {
            return "Windows ";
        }
        throw error;
    }
}
github YOCKOW / Action-setup-swift / node_modules / @octokit / request / node_modules / universal-user-agent / dist-src / node.js View on Github external
export function getUserAgent() {
    try {
        return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
    }
    catch (error) {
        if (/wmic os get Caption/.test(error.message)) {
            return "Windows ";
        }
        return "";
    }
}
github maierj / fastlane-action / .github / actions / statistics-chart-action / node_modules / @octokit / rest / node_modules / universal-user-agent / dist-src / node.js View on Github external
export function getUserAgent() {
    try {
        return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
    }
    catch (error) {
        if (/wmic os get Caption/.test(error.message)) {
            return "Windows ";
        }
        throw error;
    }
}
github AlduinApp / alduin / src / script / components / modals / tracker-modal.jsx View on Github external
async _createToken(callback) {

    this.props.displayLoader()

    let tokenReqBody = {}

    if (this._inputs.dntm.checked === true) {

      tokenReqBody = {
        locale: remote.app.getLocale(),
        os: osName()
      }

      if (os.platform() === 'linux') {
        const os = await promisify(getos)()
        tokenReqBody = { ...tokenReqBody, os: `${os.dist} ${os.release}` }
      }
    } else {
      this.props.dntm()
      tokenReqBody = {
        dntm: true
      }
    }

    const res = await fetch('http://alduin.stouder.io:4000/api/token', {
      method: 'POST',
      mode: 'cors',
github beakerbrowser / beaker / app / background-process / analytics.js View on Github external
return new Promise((resolve, reject) => {
    var qs = querystring.stringify({userId: pingData.id, os: osName(), beakerVersion: app.getVersion()})
    debug('Sending ping to %s: %s', ANALYTICS_SERVER, qs)

    var req = https.request({
      method: 'POST',
      hostname: ANALYTICS_SERVER,
      path: '/ping?' + qs
    }, (res) => {
      if (res.statusCode === 204) {
        debug('Ping succeeded')
        resolve()
      } else {
        res.setEncoding('utf8')
        res.pipe(concat(body => debug('Ping failed', res.statusCode, body)))
        reject()
      }
    })

os-name

Get the name of the current operating system. Example: macOS Sierra

MIT
Latest version published 5 months ago

Package Health Score

76 / 100
Full package analysis

Popular os-name functions