@rugo-vn/fx

1.0.3 • Public • Published

Rugo Fx

Rugo Fx for running code.

Overview

It requires @rugo-vn/storage.

Common

Fx

Fx Service using Fx class to run code.

const fx = new Fx(/* globals opts */);
const res = await fx.run(nameOrCode, opts);

/* or */
Fx.run(nameOrCode, opts);

About opts:

const opts = {
  async get(name){ /* get fn, must return code } */ },
  locals: { /* locals in code run */ },
  mode: /* some of mode `block` or `inline` or `file`, default `block` */,
  type: /* type of code `js` or `ejs`, default `js` */,
}

Input Args

All action must have:

  • spaceId
  • driveName

Actions

run

Arguments:

  • entry: Path to start run code.
  • locals locals to bind to code

Default Locals

table

const data = await table(tableName).actionName(args);

It will call db.<action>, with inherit spaceId.

License

MIT.

Readme

Keywords

none

Package Sidebar

Install

npm i @rugo-vn/fx

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

10.5 kB

Total Files

10

Last publish

Collaborators

  • haova