os-name

WebJar for os-name

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

os-name
Last Version

Last Version

3.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

os-name
WebJar for os-name
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/os-name

Download os-name

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/os-name/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>os-name</artifactId>
    <version>3.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/os-name/
implementation 'org.webjars.npm:os-name:3.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/os-name/
implementation ("org.webjars.npm:os-name:3.1.0")
'org.webjars.npm:os-name:jar:3.1.0'
<dependency org="org.webjars.npm" name="os-name" rev="3.1.0">
  <artifact name="os-name" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='os-name', version='3.1.0')
)
libraryDependencies += "org.webjars.npm" % "os-name" % "3.1.0"
[org.webjars.npm/os-name "3.1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : macos-release jar [2.2.0,3)
org.webjars.npm : windows-release jar [3.1.0,4)

Project Modules

There are no modules declared in this project.

os-name

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

Useful for analytics and debugging.

Install

$ npm install os-name

Usage

const os = require('os');
const osName = require('os-name');

// On a macOS Sierra system

osName();
//=> 'macOS Sierra'

osName(os.platform(), os.release());
//=> 'macOS Sierra'

osName('darwin', '14.0.0');
//=> 'OS X Yosemite'

osName('linux', '3.13.0-24-generic');
//=> 'Linux 3.13'

osName('win32', '6.3.9600');
//=> 'Windows 8.1'

API

osName(platform?, release?)

By default, the name of the current operating system is returned.

You can optionally supply a custom os.platform() and os.release().

Check out getos if you need the Linux distribution name.

Contributing

Production systems depend on this package for logging / tracking. Please be careful when introducing new output, and adhere to existing output format (whitespace, capitalization, etc.).

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
3.1.0
3.0.0
2.0.1
1.0.3