Giter Club home page Giter Club logo

Comments (4)

thetutlage avatar thetutlage commented on June 26, 2024

Not sure I understand what you mean by I find it a bit clunky to import them all separately, is there a better way?. Can you please share some code that you have written and you want to improve?

from edge.

Craigzyc avatar Craigzyc commented on June 26, 2024
let edge = require("edge-js");

let exports = {};

let imports = [
  __dirname + "/../cs/example.dll",
  __dirname + "/../cs/example2.dll",
  __dirname + "/../cs/example3.dll"
];

exports.Open = edge.func({
  source: __dirname + "/../cs/Example.cs",
  methodName: "Open",
  references: imports,
});

exports.GetName = edge.func({
  source: __dirname + "/../cs/Example.cs",
  methodName: "GetName",
  references: imports,
});

exports.GetPoints = edge.func({
  source: __dirname + "/../cs/Example.cs",
  methodName: "GetPoints",
  references: imports,
});

exports.GetPoint = edge.func({
  source: __dirname + "/../cs/Example.cs",
  methodName: "GetPoint",
  references: imports,
});

exports.SetPoint = edge.func({
  source: __dirname + "/../cs/Example.cs",
  methodName: "SetPoint",
  references: imports,
});

module.exports = exports;

The code itself isn't bad really I dont think.
I've shortened it up. I actually import 11 dlls, and have 9 exports currently.

It works, and seemingly well. My concern is mostly that I'm loading the dlls for each export, which seems inefficient, but considering they all use the open connection under the hood well I'm guessing its optimized and only loads it once.

I couldn't see any multiple export methods in the docs, but wanted to make sure I wasn't missing something obvious as a syntax like below to export what I'm doing makes a lot of sense, or is it an abnormal use case to export a bunch of functions as none of the examples do it?

let exports = {};

exports = edge.func({
  source: __dirname + "/../cs/Example.cs",
  methodNames: ["Open", "GetName", "GetPoints", "GetPoint", "SetPoint"],
  references: imports,
});

from edge.

thetutlage avatar thetutlage commented on June 26, 2024

Are you sure, you are submitting the issue in the right repo? Coz, there is no API as edge.func

from edge.

Craigzyc avatar Craigzyc commented on June 26, 2024

Well that's embarrassing.
The one I thought this was was edge-js, which is a derivative project of another one called edge. Must have landed here after a bad google search. Confusing naming. Sorry.

from edge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.