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

rjst

v1.6.0

Published

runtime.js tests

Downloads

3

Readme

rjst

runtime.js testing/playground

Startup

./scripts/start.js
# or, if you don't want to copy over Work-In-Progress runtime.js:
./scripts/start.js --no-cpr # or `npm start` will also do this

Currently Included Kernel

Branch kernel-improvements

Features in this kernel but not in the distributed version:

  • require builtin to the kernel, without needing to load the runtimejs library
  • global.onrejectionhandle and global.onunhandledrejection
  • Various other kernel improvements

V8 flags currently set in runtime.json:

  • WebAssembly support (--expose-wasm)
  • Async/await support (--harmony-async-await)

Note

Commands in the testing groups can only be used if they're verified and can be used.

Testing Groups

http

Testing for a node compatible HTTP module (PR #103)

Commands

  • client - Makes a request to 'http://httpbin.org/ip', might hang if response never arrives (issue with the implementation).
  • server - Sets up a server to serve index.html and script.js from /srv/public on port 8080.

Verifier Check

http module can be require()ed, or the polyfill (/usr/lib/polyfill/http) can be required()ed.

cryptoTests

Tests for libsodium crypto (PR #83)

Commands

  • cryptoTests - Runs tests on the libsodium crypto implementation, outputs results to the console.

Verifier Check

libsodium object is present in runtime.

wasm

  • Required Kernel - >= Commit e5e1496 with a patch (or master/distributed kernel with --expose-wasm in v8.flags in runtime.json)

WebAssembly testing (Issue #111)

Note: Web Assembly testing is disabled by default since it significantly slows down startup time. To enable it, you must edit cmds.json and remove all the lines that say "disabled": true for the Web Assembly commands.

Commands

  • helloWorld - Outputs "Hello, world!" to the console. Binaryen compiled C++ to WebAssembly version.
  • helloWorldThinscript - Outputs "Hello, world!" to the console. Compiled ThinScript to WebAssembly version.
  • output - Outputs "Hi there!" 300 times to the console. Binaryen compiled C++ to WebAssembly version.
  • outputThinscript - Outputs "Hi there!" 300 times to the console. Compiled ThinScript to WebAssembly version.

Verifier Check

Global Wasm object is present.

asyncAwait

  • Required Kernel - >= Commit e5e1496 compiled with an extra flag (--harmony-async-await) (or master/distributed kernel with --harmony-async-await in v8.flags in runtime.json)

ES7 Async Functions and Await support testing.

Commands

  • sleepABit - Outputs a message, "sleeps" for 7 seconds, and outputs another message and exits.

Verifier Check

evaluating an async function that also awaits (async function foobar() {await foo();}) compiles without a SyntaxError.

graphics

Graphics! Pixel manipulation, fillRecting, image drawing... all that good stuff. (PR #130)

Commands

  • compareFillRects - Compares the 2 methods of fillRecting, and logs the execution time to the console.
  • drawImage - Draws a test image to the screen.

Verifier Check

runtime.graphics is present, the typeof runtime.graphics.graphicsAvailable is a function, and runtime.graphics.graphicsAvailable() returns true.

mouse

PS2 mouse. Mainly useful in combination with graphics.

Commands

  • doubleClick - Requires the user to double-click two times in order to return the command prompt.

Verifier Check

runtime.mouse is an object.

block

  • Required Library - Master library

Block device (disk) drivers! Yay, persistency!

Note

In order to use block, you must create a disk image formatted with a single FAT{16,32} partition and the filename must be disk.img (so the start script will detect it). However, you can do this easily with runtime mkimg, like so:

# must be named disk.img, but it can be any
# size you want, with any label you want.
# see `runtime mkimg --help`
runtime mkimg disk.img --size 1G --label MYDISK

Bonus: runtime mkimg is cross-platform :wink:

After doing so, you must also write a test file containing the same contents as usr/share/block/test.txt (probably just cp it) for the compareFiles test to work.

However, you can do all of this in one command, with the setupDisk script. It'll create the disk (with runtime mkimg), and create the necessary file(s). Like:

./scripts/setupDisk.js
# on some systems you many need to have root privileges:
sudo ./scripts/setupDisk.js

Commands

  • compareFiles - Compares 2 test text files, one from memory, the other from the disk, to see if they equal. Basically, it's a disk sanity check.

Verifier Check

runtime.block is an object.

Multi-Group Commands

graphicCursor

Groups

  • graphics
  • mouse

Description

Draws a white pixel where the cursor is placed, and repaints when the user moves the mouse.