@tim-code/browser-command

0.5.6 • Public • Published

browser-command

npm install @tim-code/browser-command

A companion library to gateway, this allows for backend endpoints to be called almost as if they were functions.

Philosophy

import * as command from "@tim-code/autotest"

// note this filename needs to correspond to backend cookie/endpoint (i.e. "fs")
// alternatively can just pass string instead of "import.meta.url"
// command.post("fs", "root")
command.post(import.meta.url, "root")
command.get(import.meta.url, "root")
command.request(import.meta.url, "root")
command.factory(import.meta.url)("root")

Typeical Usage

From web-service:

const run = command.factory(import.meta.url)

export function fetch(url, options = {}) {
  return run("fetch", { url, options })
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.5.66latest

Version History

VersionDownloads (Last 7 Days)Published
0.5.66
0.5.50
0.5.40
0.5.30
0.5.20
0.5.10
0.5.00
0.4.20
0.4.10
0.4.00
0.3.50
0.3.40
0.3.30
0.3.20
0.3.10
0.3.00
0.2.40
0.2.20
0.2.10
0.2.00
0.1.00
0.0.10

Package Sidebar

Install

npm i @tim-code/browser-command

Weekly Downloads

5

Version

0.5.6

License

MIT

Unpacked Size

4.78 kB

Total Files

6

Last publish

Collaborators

  • timspro