diff --git a/samples/system-info/index.js b/samples/system-info/index.js new file mode 100644 index 0000000..0a12888 --- /dev/null +++ b/samples/system-info/index.js @@ -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; + } +} diff --git a/samples/system-info/package.json b/samples/system-info/package.json new file mode 100644 index 0000000..a28efb9 --- /dev/null +++ b/samples/system-info/package.json @@ -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 ", + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "https://github.com/scramjetorg/transform-hub.git" + } + } + \ No newline at end of file