Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new sample: System-info #31

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
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 <[email protected]>",
"license": "GPL-3.0",
"repository": {
"type": "git",
"url": "https://github.com/scramjetorg/transform-hub.git"
}
}