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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@divsense-ai/rio-de-js

v1.0.1

Published

Divsense Rio Lib Builder

Downloads

48

Readme

rio-de-js

Concise JavaScript toolchain for loading, compiling, and executing Rio modules.

rio-de-js provides:

  • Recursive Rio import resolution
  • Compilation to executable JavaScript functions
  • Built-in standard libraries (ramda, io, math, number, promise)
  • A small CLI for inspect/exec/static output

Install

npm install rio-de-js

For local development in this repository:

npm install
npm test

Quick Start (Programmatic API)

const fs = require('fs')
const { rioLibs, fci, libFunction } = require('rio-de-js')

const fetch = url => {
  const [protocol] = url.split('://')
  if (protocol !== 'file') return Promise.reject(new Error('Only file:// in this example'))

  const path = url.replace('file://', '')
  try {
    return Promise.resolve(fs.readFileSync(path, 'utf8'))
  } catch (e) {
    return Promise.reject(e)
  }
}

;(async () => {
  const url = 'file://./examples/calc.rio'
  const libs = await fci(url, rioLibs, fetch)

  const summa = libFunction(libs, url, 'summa')
  const result = summa([{ value: 1 }, { value: 2 }])

  console.log(result) // 3
})()

CLI

Entrypoint:

node ./bin/rio.js <command> <path-without-.rio> [functionName] [flags]

Example path: ./examples/maybe means file ./examples/maybe.rio.

Commands:

  • view <path>: print compiled exported functions
  • lib <path>: same output as view
  • ast <path>: print parsed Rio AST
  • exec <path> <name> [-p]: execute one exported function
  • static <path> [-o output.js]: emit CommonJS module source

Flags:

  • -p / --promise: treat exec result as a Promise and print resolved value
  • -o <file>: output file path for static

Notes:

  • exec currently calls the function with no arguments.
  • CLI reads files through file:// protocol from current working directory.

Built-in Libraries

Default in scope:

  • ramda

Available via import:

  • io: delay, delayBy, log, getJson, getXml
  • math: JavaScript Math function wrappers
  • number: parseInt, parseFloat, toNumber, isNaN
  • promise: promiseResolve, promiseReject, promiseAll, promiseRace

Rio import examples:

import 'math'
import 'io' { delay }
import 'promise' { promiseResolve }

Public API

require('rio-de-js') exports:

  • rioLibs: default library registry
  • install(name, ast, libs): compile/install one Rio AST into libs map
  • resolveImports(ast, libs): list missing imports for a parsed AST
  • libFunction(libs, url, exportName): get compiled exported function
  • fci(url, libs, fetch, endpoints?): fetch + compile + install recursively
  • msm(ast): build static CommonJS source from AST ({ code, unresolved })

Legacy compatibility file in this repo:

  • rio.de.js also exposes lower-level helpers (buildScope, compile, makeLib)

Known Limitations (Current Repo State)

  • static can fail on modules that use bare imports without explicit specifiers (for example import 'math').

Repository Layout

  • src/: compiler/install/linker core
  • helpers/: fetch-compile-install and static-module helpers
  • libs/: built-in library symbol/function tables
  • examples/: sample Rio modules
  • test/: mocha tests for examples and fetch/install flow
  • bin/rio.js: CLI