Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions samples/system-info/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const os = require("os");

module.exports = async function*(input, _timeout) {
const timeout = +_timeout || 1000;
console.log({timeout});

while (true) {
const next = new Promise(res => setTimeout(res, timeout));
yield {
type: "basic",
ts: Date.now(),
mem: os.freemem()
}
await next;
}
}
13 changes: 13 additions & 0 deletions samples/system-info/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@scramjet/system-info",
"version": "0.18.0",
"description": "Sequence that outputs a stream of system information from any server.",
"main": "./index.js",
"author": "Scramjet <open-source@scramjet.org>",
"license": "GPL-3.0",
"repository": {
"type": "git",
"url": "https://github.com/scramjetorg/transform-hub.git"
}
}