npm.io
1.0.1 • Published 5 years ago

pluto-rest

Licence
MIT
Version
1.0.1
Deps
1
Size
8 kB
Vulns
0
Weekly
0
Stars
1

pluto-rest

A JavaScript interface for the Pluto.jl "What you see is what you REST" web API.

Installation

npm install pluto-rest

Usage

The following example is based off the REST Docs.jl Pluto notebook. Also note that this example must be wrapped in an async function.

const { PlutoNotebook } = require('pluto-rest')

const nb = new PlutoNotebook('REST Docs.jl')

// Evaluation
console.log(await nb.c)  // prints 5
console.log(await nb({a: 5, b: 12}).c)  // prints 13

// Calling functions
console.log(await (await nb.distance)(3, 4, 12))  // prints 13