0.7.1 • Published 4 years ago

@procdev/client v0.7.1

Weekly downloads
-
License
MPL-2.0
Repository
-
Last release
4 years ago

This is the official JavaScript client for Proc: Serverless web functions with superpowers.

Install

The easiest way to use the proc client from the browser is through the skypack cdn:

(async () => {
  const Proc = await import("https://cdn.skypack.dev/@procdev/client");
  const client = Proc.connect("{your-proc-authorization}");

  ...
})();

To use the proc client from node, install @procdev/client using npm, then use it like this:

const Proc = require("@procdev/client");
const client = Proc.connect("{your-proc-authorization}");

...

Usage

Call procs just like local code:

client.type.number.add.call(1, {value: 1});

=> 2

Build more complex behaviors with compose:

let time = client.time;
let composition = time.now.compose(
  time.format(undefined, {string: "%A"})
);

composition.call();

=> "Tuesday"

Deploy custom endpoints instantly and call them from anywhere:

client.proc.create.call(undefined, {name: "day_of_week", proc: composition});

client.self.day_of_week.call();

=> "Tuesday"

Learn more at proc.dev. See you around!

0.7.1

4 years ago

0.5.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.3.1

4 years ago

0.1.0

4 years ago

0.0.0

4 years ago