Giter Site home page Giter Site logo

jint.commonjs's People

Contributors

tylerjwatson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jint.commonjs's Issues

MissingMethodException?

Writing a simple VSMac Jint/Jint.CommonJS console app, and I'm running into a MissingMethodException being tossed from this code:

var cjs = engine.CommonJS();
cjs.RegisterInternalModule("console", typeof(Console));

This is with 3.0beta of Jint, if that makes a difference.

The exception looks like:

System.MissingMethodException: "Method not found: 'Jint.Native.JsValue Jint.Native.JsValue.op_Implicit(Jint.Native.Object.ObjectInstance)'."
  at Jint.CommonJS.ModuleLoadingEngine.RegisterInternalModule(String id, Type clrType)\n   at JintExplorer.Program.Main(String[] args) in /Users/tedneward/Projects/JintExplorer/JintExplorer/Program.cs:46

Any insights appreciated, particularly if this is a user bug. (Just started playing with Jint.CJS.)

node Require

Hello,

Thank you for providing this extension to Jint!

You are not able to load npm packages with Jint.CommonJS. Although the library loads modules in relatively the same format at NodeJS's Module specification, there are some important distinctions. The library does not support node_modules, or reading package.json files for modules.

Do you know of any Jint extension that can handle basic node requires (no package.json)?

Thanks,
Ben

Problem trying to create an instance of function class from a js module.

Im trying to create an instance of a function class from a js module and use it.

I have tried to do the following:

var AHRS = scriptEngine.CommonJS().RunMain(path + folder + "node_modules/ahrs/index");

where I assume AHRS should contain the following function class called "AHRS": https://github.com/psiphi75/ahrs/blob/master/index.js used like so: https://github.com/psiphi75/ahrs

I run a second snippet with the same ScriptEngine:

var value = scriptEngine.GetValue("update").Invoke(AHRS, 0, 0, 0, 1, 1, 1, 2, 2, 2);

Which looks like:

function update(ahrs, gX, gY, gZ, aX, aY, aZ, mX, mY, mZ) {
    // let ahrs = new AHRS({ sampleInterval: 20, algorithm: 'Madgwick', beta: 0.4 });
    // ahrs.update(gX, gY, gZ, aX, aY, aZ, mX, mY, mZ);
    // ahrs.getEulerAngles()
    const s = new ahrs(null);
    return JSON.stringify(s);
}

where I am unable to call method on the AHRS instance. Logging the return of update - I get an empty object: {};

Any help is very much appreciated. My overhead goal is to use the AHRS javascript library in C# in a Xamarin.Forms app.

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.