diff --git a/.gitignore b/.gitignore index 58e00ab..f6db185 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +.eslintrc.json +package-lock.json + +test/ +dist/ +index.d.ts +tsconfig.json +tslint.json +typings.d.ts diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cb124c2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: node_js + +os: + - windows + - linux + - osx + +node_js: + - "6" + - "8" + - "10" + +sudo: false + +after_success: npm run coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index b95f345..f3ead13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 | diff --git a/README.md b/README.md index e11c3d9..eaa7fab 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/package.json b/package.json index 5f8d8fb..914e76d 100644 --- a/package.json +++ b/package.json @@ -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 } }