{"_id":"@divsense-ai/rio-de-js","name":"@divsense-ai/rio-de-js","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@divsense-ai/rio-de-js","version":"1.0.1","description":"Divsense Rio Lib Builder","main":"index.js","scripts":{"play":"node play/driver.js","test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/divsense/rio-de-js.git"},"keywords":["rio","divsense","compiler","javascript"],"author":{"name":"haknick"},"license":"MIT","bugs":{"url":"https://github.com/divsense/rio-de-js/issues"},"bin":{"rio":"bin/rio.js"},"homepage":"https://github.com/divsense/rio-de-js#readme","devDependencies":{"minimist":"^1.2.8","mocha":"^11.7.5","ramda":"^0.32.0"},"dependencies":{"astring":"^1.9.0","most":"^1.9.0","riojs":"0.4.0"},"gitHead":"15a33c9f059142d8ca0762eb076251e377f137f0","_id":"@divsense-ai/rio-de-js@1.0.1","_nodeVersion":"25.6.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-YRe2KXG9s9HUtV26e/Ayppm79bLAfjzOIhP1q2LKT7oo2fg5aaVgRTyzRwfpxLXM0Uav1HdOrkNLHS0k8gwhKg==","shasum":"067a640c9ddb64c0dacdec2e74dacbf7a35ca55b","tarball":"https://registry.npmjs.org/@divsense-ai/rio-de-js/-/rio-de-js-1.0.1.tgz","fileCount":55,"unpackedSize":92725,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH9M3MiUcg8y1X+ki6I7j9kjtATbztp/3VpdT1cGvs3dAiAyKDWi2x4/8g2DDFkXBIGWMEgjrDbGwWb/G82/NY0fqw=="}]},"_npmUser":{"name":"haknick-ai","email":"dvs.vagrant@gmail.com"},"directories":{},"maintainers":[{"name":"haknick-ai","email":"dvs.vagrant@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rio-de-js_1.0.1_1771081127340_0.6890977840547137"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-14T14:58:47.281Z","1.0.1":"2026-02-14T14:58:47.478Z","modified":"2026-02-14T14:58:47.651Z"},"maintainers":[{"name":"haknick-ai","email":"dvs.vagrant@gmail.com"}],"description":"Divsense Rio Lib Builder","homepage":"https://github.com/divsense/rio-de-js#readme","keywords":["rio","divsense","compiler","javascript"],"repository":{"type":"git","url":"git+https://github.com/divsense/rio-de-js.git"},"author":{"name":"haknick"},"bugs":{"url":"https://github.com/divsense/rio-de-js/issues"},"license":"MIT","readme":"# rio-de-js\n\nConcise JavaScript toolchain for loading, compiling, and executing [Rio](https://www.npmjs.com/package/riojs) modules.\n\n`rio-de-js` provides:\n- Recursive Rio import resolution\n- Compilation to executable JavaScript functions\n- Built-in standard libraries (`ramda`, `io`, `math`, `number`, `promise`)\n- A small CLI for inspect/exec/static output\n\n## Install\n\n```bash\nnpm install rio-de-js\n```\n\nFor local development in this repository:\n\n```bash\nnpm install\nnpm test\n```\n\n## Quick Start (Programmatic API)\n\n```js\nconst fs = require('fs')\nconst { rioLibs, fci, libFunction } = require('rio-de-js')\n\nconst fetch = url => {\n  const [protocol] = url.split('://')\n  if (protocol !== 'file') return Promise.reject(new Error('Only file:// in this example'))\n\n  const path = url.replace('file://', '')\n  try {\n    return Promise.resolve(fs.readFileSync(path, 'utf8'))\n  } catch (e) {\n    return Promise.reject(e)\n  }\n}\n\n;(async () => {\n  const url = 'file://./examples/calc.rio'\n  const libs = await fci(url, rioLibs, fetch)\n\n  const summa = libFunction(libs, url, 'summa')\n  const result = summa([{ value: 1 }, { value: 2 }])\n\n  console.log(result) // 3\n})()\n```\n\n## CLI\n\nEntrypoint:\n\n```bash\nnode ./bin/rio.js <command> <path-without-.rio> [functionName] [flags]\n```\n\nExample path: `./examples/maybe` means file `./examples/maybe.rio`.\n\nCommands:\n- `view <path>`: print compiled exported functions\n- `lib <path>`: same output as `view`\n- `ast <path>`: print parsed Rio AST\n- `exec <path> <name> [-p]`: execute one exported function\n- `static <path> [-o output.js]`: emit CommonJS module source\n\nFlags:\n- `-p` / `--promise`: treat `exec` result as a Promise and print resolved value\n- `-o <file>`: output file path for `static`\n\nNotes:\n- `exec` currently calls the function with no arguments.\n- CLI reads files through `file://` protocol from current working directory.\n\n## Built-in Libraries\n\nDefault in scope:\n- `ramda`\n\nAvailable via import:\n- `io`: `delay`, `delayBy`, `log`, `getJson`, `getXml`\n- `math`: JavaScript `Math` function wrappers\n- `number`: `parseInt`, `parseFloat`, `toNumber`, `isNaN`\n- `promise`: `promiseResolve`, `promiseReject`, `promiseAll`, `promiseRace`\n\nRio import examples:\n\n```rio\nimport 'math'\nimport 'io' { delay }\nimport 'promise' { promiseResolve }\n```\n\n## Public API\n\n`require('rio-de-js')` exports:\n- `rioLibs`: default library registry\n- `install(name, ast, libs)`: compile/install one Rio AST into libs map\n- `resolveImports(ast, libs)`: list missing imports for a parsed AST\n- `libFunction(libs, url, exportName)`: get compiled exported function\n- `fci(url, libs, fetch, endpoints?)`: fetch + compile + install recursively\n- `msm(ast)`: build static CommonJS source from AST (`{ code, unresolved }`)\n\nLegacy compatibility file in this repo:\n- `rio.de.js` also exposes lower-level helpers (`buildScope`, `compile`, `makeLib`)\n\n## Known Limitations (Current Repo State)\n\n- `static` can fail on modules that use bare imports without explicit specifiers (for example `import 'math'`).\n\n## Repository Layout\n\n- `src/`: compiler/install/linker core\n- `helpers/`: fetch-compile-install and static-module helpers\n- `libs/`: built-in library symbol/function tables\n- `examples/`: sample Rio modules\n- `test/`: mocha tests for examples and fetch/install flow\n- `bin/rio.js`: CLI\n","readmeFilename":"README.md","_rev":"1-85c7572425b49f70b504ae3b819ae9f4"}