1
Watch
1
Star
0
Fork
0
Issue

The 'os' module from Node.js, ported to Scriptable. This project has moved over to npm-scriptable.

Rhinozz
Rhinozz
pushedAt 6 months ago

Rhinozz/os-scriptable

os-scriptable - MOVED TO https://github.com/Rhinozz/npm-scriptable

The 'os' module from Node.js, ported to Scriptable.

Constants:

  • EOL

End of line character.

  • constants

OS constants - does not work.

Functions:

  • arch()

Get CPU architecture.

  • cpus()

Get details of CPU cores - not great, very hacky.

  • endianness()

Get CPU endianness.

  • freemem()

Get free memory - does not work.

  • getPriority(pid)

Get priority of item by PID - does not work.

  • homedir()

Get the home directory.

  • hostname()

Get device name.

  • loadavg()

Get load averages - Unix-specific, set to [0, 0, 0] for non-Unix.

  • networkInterfaces()

Get internet connections - does not return IPs besides 127.0.0.1, basically unusable.

  • platform()

Get OS platform.

  • release()

Get OS release version.

  • setPriority(pid, priority)

Set prioriry of item by PID - does not work.

  • tmpdir()

Get the temporary directory.

  • totalmem()

Get total device memory - not great, very hacky.

  • type()

Get OS kernel type.

  • uptime()

Get OS uptime - does not work.

  • userInfo(options)

Get user and device info.

  • version()

Get kernel version.

Usage

const { os } = importModule('os.js');
// your code here, using os as you would in node

Feel free to optimize and improve, or post issues!

ucloud ads