Skip to content

Commit 1a01d51

Browse files
committed
Add system info
1 parent 4b7a163 commit 1a01d51

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

samples/system-info/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const os = require("os");
2+
3+
module.exports = async function*(_timeout) {
4+
const timeout = +_timeout || 1000;
5+
console.log({timeout});
6+
7+
while (true) {
8+
const next = new Promise(res => setTimeout(res, timeout));
9+
yield {
10+
ts: Date.now(),
11+
mem: os.freemem()
12+
}
13+
await next;
14+
}
15+
}

samples/system-info/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@scramjet/system-info",
3+
"version": "0.18.1",
4+
"description": "Sequence that outputs a stream of system information from any server.",
5+
"main": "./index.js",
6+
"author": "Scramjet <[email protected]>",
7+
"license": "GPL-3.0",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/scramjetorg/transform-hub.git"
11+
}
12+
}
13+

0 commit comments

Comments
 (0)