https://github.com/bash/node-uname
Wrapper around the uname call
https://github.com/bash/node-uname
Last synced: 12 months ago
JSON representation
Wrapper around the uname call
- Host: GitHub
- URL: https://github.com/bash/node-uname
- Owner: bash
- Created: 2016-01-09T11:57:03.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T22:09:42.000Z (about 1 year ago)
- Last Synced: 2025-03-09T08:43:50.226Z (about 1 year ago)
- Language: C
- Homepage:
- Size: 201 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
Awesome Lists containing this project
README
# node-uname
[](https://github.com/bash/node-uname/actions)
[](https://www.npmjs.com/package/node-uname)
A wrapper around the `uname` call.
Works on GNU/Linux and MacOS.
## Installation
```bash
npm install node-uname
```
## Example
```javascript
import { uname } from 'node-uname'
console.log(uname())
// Utsname {
// sysname: 'Darwin',
// nodename: 'MacBook.local',
// release: '15.0.0',
// version: 'Darwin Kernel Version ...',
// machine: 'x86_64' }
```
## uname()
The uname() function returns an object containing `sysname`, `nodename`, `release`, `version` and machine.
If the internal call to the kernel's [`uname`](http://man7.org/linux/man-pages/man2/uname.2.html) function fails an [Error](https://nodejs.org/api/errors.html) is thrown.