Skip to content

Commit 864df79

Browse files
committed
Initial commit
1 parent 587552f commit 864df79

16 files changed

Lines changed: 5614 additions & 0 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
lib/
3+
coverage/

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"trailingComma": "all",
4+
"singleQuote": true
5+
}

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
![GitHub package.json version](https://img.shields.io/github/package-json/v/LupCode/node-lup-system)
2+
![npm bundle size](https://img.shields.io/bundlephobia/min/lup-system)
3+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/LupCode/node-lup-system/On%20Push)
4+
![NPM](https://img.shields.io/npm/l/lup-system)
5+
6+
# lup-system
7+
Node module that provides utilities for interacting with the operating system and the hardware of the machine.
8+
9+
## Example
10+
11+
JavaScript:
12+
```javascript
13+
const osUtils = require('lup-system');
14+
15+
osUtils.getCpuUtilization().then(utilization => console.log("CPU Utilization: " + utilization));
16+
osUtils.getDrives().then(drives => console.log("Drives: " + drives)); // Array of drive objects
17+
osUtils.getNetworkInterfaces().then(interfaces => console.log("Network Interfaces: " + interfaces));
18+
```
19+
20+
TypeScript:
21+
```typescript
22+
import osUtils from 'lup-system';
23+
24+
(async () => {
25+
console.log("CPU Utilization: " + await osUtils.getCpuUtilization());
26+
console.log("Drives: ", await osUtils.getDrives()); // Array of drive objects
27+
console.log("Network Interfaces: ", await osUtils.getNetworkInterfaces());
28+
})();
29+
```
30+
31+
Output:
32+
```
33+
CPU Utilization: 45.3
34+
```

jestconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"transform": {
3+
"^.+\\.(t|j)sx?$": "ts-jest"
4+
},
5+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
6+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
7+
"collectCoverage":true
8+
}

0 commit comments

Comments
 (0)