linux-release-info
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -0,7 +1,16 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
## [3.0.0] - 2020-07-20 | ||
### Changed | ||
- Completely rewrite in TypeScript | ||
## [2.0.0] - 2018-11-02 | ||
* Read file synchronously option | ||
* Search on '/etc/os-release', '/usr/lib/os-release' or in a specified custom file | ||
* Code improvements (now requires Node >= 8) | ||
### Changed | ||
- Read file synchronously option | ||
- Search on '/etc/os-release', '/usr/lib/os-release' or in a specified custom file | ||
- Code improvements (now requires Node >= 8) | ||
## [1.0.0] - 2018-02-10 | ||
* First public version | ||
- First public version |
{ | ||
"name": "linux-release-info", | ||
"version": "2.0.0", | ||
"productName": "Linux Release Info", | ||
"version": "3.0.0", | ||
"description": "Get Linux release info (distribution name, version, arch, release, etc.) from 'os-release' file and from native os module. On Windows and Darwin it only returns common node os module info (platform, hostname, release and arch)", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "node test.js", | ||
"build": "tsc", | ||
"watch": "tsc -w", | ||
"publish": "npm publish", | ||
"lint": "xo" | ||
}, | ||
@@ -28,7 +34,12 @@ "repository": { | ||
"homepage": "https://github.com/samuelcarreira/linux-release-info#readme", | ||
"devDependencies": {}, | ||
"engines": { | ||
"node": ">=8.0" | ||
}, | ||
"dependencies": {} | ||
"devDependencies": { | ||
"typescript": "^3.9.7", | ||
"xo": "^0.32.1" | ||
}, | ||
"files": [ | ||
"dist/**/*" | ||
] | ||
} |
@@ -1,17 +0,22 @@ | ||
linux-release-info | ||
================= | ||
# Linux Release Info | ||
Get Linux release info (distribution name, version, arch, release, etc.) from '/etc/os-release' or '/usr/lib/os-release' files and from native os module. On Windows and Darwin platforms it only returns common node os module info (platform, hostname, release, and arch) | ||
### Highlights | ||
* Lightweight without any dependencies (only native Node modules) | ||
* Asynchronous file reading | ||
* Synchronous file reading (NEW feature version >= 2.0.0) | ||
* Specify custom os-release file | ||
## Key Features | ||
* **Secure and lightweight:** (without any dependencies, only native Node modules) | ||
* **Asynchronous file reading** | ||
* **Synchronous file reading (NEW feature version >= 2.0.0)** | ||
* **Specify custom os-release file** | ||
* **Written in TypeScript** | ||
* **Well documented and easy to use** | ||
## Installation | ||
``` | ||
npm install --save linux-release-info | ||
npm install --save linux-release-info | ||
``` | ||
or | ||
``` | ||
yarn add linux-release-info | ||
``` | ||
@@ -21,3 +26,3 @@ ## Usage | ||
``` | ||
const releaseInfo = require('linux-release-info'); | ||
const {releaseInfo} = require('linux-release-info'); | ||
@@ -51,9 +56,9 @@ releaseInfo() | ||
## Options | ||
- `options` `<Object>` | ||
- `mode` `<string>`: 'sync' or 'async' mode. Default is *async* mode | ||
- `custom_file` `<string>`: custom complete filepath with os info. If not provided the system will search on the '/etc/os-release' and '/usr/lib/os-release' files. Default is `null/none` | ||
- `debug` `<boolean>`: show console debug messages. Default is `false` | ||
Property | Type | Default | Description | ||
---------------- | -------- | ---------- | ---------------------- | ||
`mode` | `string` | `async` | 'sync' or 'async' mode | ||
`custom_file` | `string` | `null/none` | custom complete filepath with os info. If not provided the system will search on the `/etc/os-release` and `/usr/lib/os-release` files | ||
`debug` | `boolean` | `false` | shows console debug messages | ||
### Sample outputs | ||
@@ -86,7 +91,8 @@ **Linux** | ||
arch: 'arm', | ||
release: '4.9.59-v7+', | ||
pretty_name: 'Raspbian GNU/Linux 9 (stretch)', | ||
release: '4.19.118-v7+', | ||
pretty_name: 'Raspbian GNU/Linux 10 (buster)', | ||
name: 'Raspbian GNU/Linux', | ||
version_id: '9', | ||
version: '9 (stretch)', | ||
version_id: '10', | ||
version: '10 (buster)', | ||
version_codename: 'buster', | ||
id: 'raspbian', | ||
@@ -148,10 +154,12 @@ id_like: 'debian', | ||
If you want info about Windows or Mac releases, you can try the following modules from sindresorhus: | ||
https://www.npmjs.com/package/win-release | ||
- https://www.npmjs.com/package/win-release | ||
or | ||
https://www.npmjs.com/package/macos-release | ||
- https://www.npmjs.com/package/macos-release | ||
## License | ||
Licensed under MIT | ||
- Licensed under MIT | ||
Copyright (c) 2018 [Samuel Carreira] | ||
- Copyright (c) 2018-2020 [Samuel Carreira] |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
16869
190
0
161
2
7
1