npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

runtime-cli

v3.2.0

Published

runtime.js cli

Downloads

10

Readme

runtime-cli

Command line tools for runtime.js.

Build Status npm

Installation

npm install -g runtime-cli

Usage

USAGE: runtime <command> [<args>]

Commands:
  start         Quickly start runtime.js VM using current directory
  watch         Watch current directory and automatically restart runtime.js VM
  pack          Package specified directory into ramdisk bundle
  run           Run runtime.js VM using specified ramdisk bundle
  show          Print VM output or log
  mkimg         Easily create a disk image for use with runtime.js
  help          Print this usage help

Getting Started

To setup a project simply install runtimejs package as a dependency. It doesn't need to be require()-d anywhere, just make sure it exists in node_modules.

mkdir project
cd project
npm install runtimejs
echo "console.log('ok')" > index.js

Run project in QEMU VM:

runtime start

Or let it watch directory for changes and restart QEMU automatically:

runtime watch

Commands

start, watch and run commands are very similar and have pretty much the same list of arguments. They all launch runtime.js in the QEMU VM.

USAGE: runtime start [<args>]
(Quickly start runtime.js VM using current directory)

Arguments:
  --net         Enable network (value can be "none", "user", "tap" or
                "bridge", defaults to "user")
  --netdump     Save network activity to a file
  --kvm         Enable Linux KVM (much faster virtualization)
  --curses      Use text-mode graphics
  --port        Redirect TCP/UDP connections on the host port to the runtime.js
  --append      Append string to runtime.js command line
  --dry-run     Test input but do not launch the VM
  --verbose     Output extra info like VM command line
  --virtio-rng  Enable VIRTIO-RNG entropy source for the runtime.js
  --nographic   Disable graphics, run in command line mode
  --kernel      Specify custom kernel binary file to use
  --local       Download the kernel locally (i.e. in the module's directory)

pack packages directory into ramdisk/initrd bundle. This is useful if you'd like to ship compiled bundle somewhere and don't want to run it locally.

USAGE: runtime pack [<args>] <directory>
(Package specified directory into ramdisk bundle)

  <directory>   Directory to package

Arguments:
  --list-files  List packaged files only
  --ignore      Add file ignore pattern
  --entry       Set entry point import/require string (defaults to "/")
  --add-dir     Add a directory into the package (format: <path> or <path>:<package-path>)

mkimg creates a FAT disk image for use with runtime.js. On some systems, you may need to use root/administrator privileges. Depends on qemu-img on all platforms, hdiutil and diskutil on macOS (builtin), losetup and mkfs.msdos on Linux (included on most distributions), and diskpart on Windows (bulitin).

USAGE: runtime mkimg [<args>] <filename>
(Easily create a disk image for use with runtime.js)

  <filename>    The filename for the newly created disk image including the extension,
                default to "disk.img"

Arguments:
  --size        Size of the new image, defaults to 1 gigabyte. See `qemu-img --help` for sizes.
                Must be >= 33792 kb (~33 mb)
  --label       Label of the new image, defaults to "RUNTIMEJS"

Environment Variables

While there is a proposal to add envirionment variables from the command line, there is currently no officially supported process for passing them into a runtime instance. However, there is a work around that will allow the passing of Kernel Command Line arguments instead.

runtime run --append <your env args> initrd

To access this variable in your code use the following:

const wholeString = __SYSCALL.getCommandLine();
const arrayOfArguments = wholestring.split(' ');
arrayOfArguments[i]; // where i is the index of your argument in the array

Completion

Enables tab-completion for all commands.

runtime completion >> ~/.bashrc
runtime completion >> ~/.zshrc

License

Apache License, Version 2.0