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

jsos-cli

v3.3.1

Published

JsOS CLI

Downloads

6

Readme

JsOS-CLI

Command line tools for JsOS.

npm

Installation

npm i -g jsos-cli

Usage

USAGE: jsos <command> [<args>]

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

Getting Started

To setup a project simply clone JsOS repository

git clone https://github.com/JsOS-Team/JsOS
cd JsOS
npm i

Run project in QEMU VM:

jsos start

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

jsos watch

Commands

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

USAGE: jsos start [<args>]
(Quickly start JsOS 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)
  --pcspk       Enable PCSpeaker emulation (if you haven't native)
  --usb         Enable usb (ehci) device emulation (for testing)
  --curses      Use text-mode graphics
  --port        Redirect TCP/UDP connections on the host port to the JsOS
  --append      Append string to JsOS 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 JsOS
  --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)
  --pcspk       Enable PCSpeaker emulation
  --usb         Enable USB EHCI device emulation

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: jsos 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 JsOS. 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: jsos mkimg [<args>] <filename>
(Easily create a disk image for use with JsOS)

  <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 "JSOS"

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.

jsos 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.

jsos completion >> ~/.bashrc
jsos completion >> ~/.zshrc

License

Apache License, Version 2.0