preparing automated tests, travis-ci integration, added dev-dependencies

This commit is contained in:
Sebastian Hildebrandt 2018-12-28 22:36:48 +01:00
parent 7ed25eef76
commit dc33dfb90d
5 changed files with 66 additions and 5 deletions

13
.gitignore vendored
View File

@ -12,6 +12,7 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage
.nyc_output/
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
@ -22,7 +23,7 @@ coverage
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# MacOS
# MacOS
.DS_Store
.Spotlight-V100
.Trashes
@ -57,4 +58,12 @@ npm*
.svn
.hg
CVS
.eslintrc.json
.eslintrc.json
package-lock.json
test/
dist/
index.d.ts
tsconfig.json
tslint.json
typings.d.ts

15
.travis.yml Normal file
View File

@ -0,0 +1,15 @@
language: node_js
os:
- windows
- linux
- osx
node_js:
- "6"
- "8"
- "10"
sudo: false
after_success: npm run coverage

View File

@ -100,6 +100,7 @@ Other changes
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 3.52.5 | 2018-12-28 | preparing automated tests, travis-ci integration, added dev-dependencies |
| 3.52.4 | 2018-12-27 | `graphics().controllers` bugfix linux |
| 3.52.3 | 2018-12-27 | `os().codepage` bugfix |
| 3.52.2 | 2018-12-17 | code cleanup |

View File

@ -34,7 +34,7 @@ Lightweight collection of 35+ functions to retrieve detailed hardware, system an
- simple to use
- get detailed information about system, cpu, baseboard, battery, memory, disks/filesystem, network, docker, software, services and processes
- supports Linux, macOS, partial Windows, FreeBSD and SunOS support
- no npm dependencies
- no npm dependencies (for production)
### Installation
@ -42,6 +42,8 @@ Lightweight collection of 35+ functions to retrieve detailed hardware, system an
$ npm install systeminformation --save
```
For production builds (to prevent installing `dev-dependencies`) be sure to set `NODE_ENV` environment variable to `production` befor running `npm install`
### Usage
All functions (except `version` and `time`) are implemented as asynchronous functions. Here a small example how to use them:
@ -113,7 +115,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (
| --------------- | ------------- | ----- | ------- | --- | --- | --- | -------- |
| si.version() | : string | X | X | X | X | X | lib version (no callback/promise) |
| si.time() | {...} | X | X | X | X | X | (no callback/promise) |
| | current | X | X | X | X | X | local time |
| | current | X | X | X | X | X | local (server) time |
| | uptime | X | X | X | X | X | uptime |
| | timezone | X | X | X | X | X | e.g. GMT+0200 |
| | timezoneName | X | X | X | X | X | e.g. CEST |

View File

@ -7,7 +7,12 @@
"homepage": "https://github.com/sebhildebrandt/systeminformation",
"main": "./lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"clean": "rimraf dist",
"test-bare": "npm run compile && mocha ./test/**/*.test.js",
"compile": "tsc",
"watch": "tsc -w",
"test": "nyc mocha --require ts-node/register --require source-map-support/register ./test/**/*.test.ts",
"coverage": "nyc report --reporter=text-lcov"
},
"files": [
"lib/"
@ -67,5 +72,34 @@
],
"engines": {
"node": ">=4.0.0"
},
"devDependencies": {
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.18",
"chai": "^4.2.0",
"coveralls": "^3.0.2",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"rimraf": "^2.6.2",
"source-map-support": "^0.5.9",
"ts-node": "^7.0.1",
"typescript": "^3.2.2"
},
"nyc": {
"extension": [
".js"
],
"include": [
"lib/**"
],
"exclude": [
"**/*.d.ts"
],
"reporter": [
"html",
"text"
],
"all": true
}
}