Skip to content

A package that exposes a Go function that calls n JavaScript functions.

Notifications You must be signed in to change notification settings

realpresjeff/consec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@xvanilla/consec

This package exposes a Go function called consec. It calls n number of JavaScript functions defined in the global scope.

Install

npm i -S @xvanilla/consec

Usage

import "@xvanilla/consec/static/wasm_exec";
import "@xvanilla/consec/static/instantiate";

function goodbye() {
  return "bye dude!";
}

function cool() {
  return "cool";
}

function add(x, y) {
  return x + y;
}


const funcs = [
    { name: "goodbye" },
    { name: "cool" },
    { name: "add", args: [1, 2] },
  ];
  
const res = consec(JSON.stringify(funcs));

console.log(res); // ['bye dude!', 'cool', '<number: 3>']

About

A package that exposes a Go function that calls n JavaScript functions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published