[quickjs-devel] Re: Retrieving an exported function

  • From: Fred Weigel <fred_weigel@xxxxxxxxxxx>
  • To: "quickjs-devel@xxxxxxxxxxxxx" <quickjs-devel@xxxxxxxxxxxxx>
  • Date: Mon, 27 Jan 2020 03:11:02 +0000

Peter:

Sure -- in file1.js (or .mjs)

export function f() { return 42 };

in file2.js

import { f } from "./file1.js";

console.log(f());

or even

import * as modl from "./file1.js";
console.log(modl.f());



Other related posts: