3.4.3 • Published 28 days ago

runme v3.4.3

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
28 days ago

runme: id: 01HP7J575TFZ65WYPQPZGE7STA

version: v2.2

Runme.js Test Changes npm version Join us on Discord

A JavaScript module to use Runme in Node.js.

Runme.js contains the Runme CLI 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:

$ npm install runme
# or Yarn
$ yarn add runme

You can also install the package globally and it as a CLI, e.g.:

npm i -g runme
runme list

By default this package downloads the Runme CLI 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.:

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:

import { run } from 'runme'

const result = await run('helloWorld')
console.log(result) // outputs: { exitCode: 0, stdout: 'Hello World\r\n', stderr: '' }

createServer

Runme can run various commands in a single shell session that allows you to keep environment variables around. For that you need to start a server as execution engine:

import { createServer, run } from 'runme'

const server = await createServer()

// execute `export FOO="bar"` from markdown code cell with id "export"
await run('export', server)

// execute `echo "exported FOO=$FOO"` from markdown code cell with id "print"
const result = await run('print', server)
console.log(result) // outputs: { exitCode: 0, stdout: 'exported FOO=bar\r\n', stderr: '' }

Contributing

See CONTRIBUTING.md for more information or just click on:

Run with Runme


3.4.3

28 days ago

3.4.2

28 days ago

3.4.1

28 days ago

3.4.0

3 months ago

3.3.0

3 months ago

3.2.0

3 months ago

3.1.0

6 months ago

2.3.6

11 months ago

3.0.2

9 months ago

3.0.1

11 months ago

3.0.0

11 months ago

2.3.0

1 year ago

2.2.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.4

12 months ago

2.3.3

1 year ago

2.3.5

12 months ago

2.1.0

1 year ago

2.0.0

1 year ago

0.1.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.4.4

1 year ago

0.4.1

1 year ago

0.2.3

1 year ago

0.4.0

1 year ago

0.2.2

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.2.4

1 year ago

1.0.1

9 years ago

1.0.0

9 years ago