https://github.com/runmedev/runmejs
A JavaScript module to use Runme in Node.js.
https://github.com/runmedev/runmejs
markdown notebook readme readmeops runme vscode
Last synced: 5 months ago
JSON representation
A JavaScript module to use Runme in Node.js.
- Host: GitHub
- URL: https://github.com/runmedev/runmejs
- Owner: runmedev
- License: apache-2.0
- Created: 2022-11-01T18:40:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-23T20:03:04.000Z (about 1 year ago)
- Last Synced: 2025-10-21T07:43:54.974Z (9 months ago)
- Topics: markdown, notebook, readme, readmeops, runme, vscode
- Language: TypeScript
- Homepage: https://runme.dev
- Size: 936 KB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Runme.js [](https://github.com/runmedev/runmejs/actions/workflows/test.yaml) [](https://badge.fury.io/js/runme) [](https://discord.com/invite/BQm8zRCBUY)
> A JavaScript module to use [Runme](https://runme.dev) in Node.js.
_Runme.js_ contains the [Runme CLI](https://github.com/stateful/runme) and allows to access its functionality through a simple JavaScript interface. The CLI binary is downloaded and cached when the interface is first being used.
## Install
### Node.js
Install the module through NPM:
```sh
$ npm install runme
# or Yarn
$ yarn add runme
```
You can also install the package globally and it as a CLI, e.g.:
```sh
npm i -g runme
runme list
```
By default this package downloads the [Runme CLI](https://github.com/stateful/runme) when the interface is used for the first time. You can download it after running `npm install` by setting the `RUNME_DOWNLOAD_ON_INSTALL` environment flag. You can also modify the Runme version that is being installed by setting `RUNME_VERSION`, e.g.:
```sh
RUNME_DOWNLOAD_ON_INSTALL=1 RUNME_VERSION=1.0.0 npm install runme
npx runme --version # prints "runme version 1.0.0 (adae05c5b75351e9fe82acd595ac8086b6abf19b) on 2023-03-28T20:56:21Z"
```
## Usage
The module exposes the following methods:
### `run`
Run code cells from markdown files:
```javascript {"name":"runExample"}
import { run } from "runme";
const result = await run(["helloWorld"]);
console.log(result); // outputs: { exitCode: 0, stdout: 'Hello World\r\n', stderr: '' }
```
Runme can run multiple commands in a single shell session that allows you to keep environment variables around.
```javascript {"terminalRows":"15"}
import { run } from "runme";
// execute `echo "exported FOO=$FOO"` from markdown code cell with id "print"
const result = await run(["export", "print"]);
console.log(result);
// outputs:
// {
// exitCode: 0,
// stdout: ' ► Running task export...\n' +
// ' ► ✓ Task export exited with code 0\n' +
// ' ► Running task print...\n' +
// 'exported FOO=bar\r\n' +
// ' ► ✓ Task print exited with code 0\n',
// stderr: ''
// }
```
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information or just click on:
[](https://runme.dev/api/runme?repository=https%3A%2F%2Fgithub.com%2Fstateful%2Frunmejs.git&fileToOpen=CONTRIBUTING.md)
---
Copyright 2025 © Stateful – Apache 2.0 License