Questions tagged [jint]

Jint is a JavaScript interpreter for .NET.

Jint is a script engine based on the JavaScript language. Using Jint, developers can provide fully scriptable applications, execute .NET code without compiling, or create external configuration logic, using the most used script language.

Jint aims at providing every JavaScript functionalities to .NET applications, and bindings to .NET languages can be done in both sides. Jint scripts can use any .NET object from your application, and use every part of the .NET base class library.

Jint has been rewritten completely and is now hosted on Github.

Jint Information (codeplex archive)

118 questions
1
vote
1 answer

Jint extremely slow with strings

I'm currently working on a project which requires JS support (actual program written in C#) and am using Jint as the interpreter. Before I did any further work, I ran a basic performance test to find the difference between a compiler (E.g. Chrome…
1
vote
1 answer

Return edited XML string with Javascript

I'm using the the XML for < script > library W3C DOM Parser available here. (This because I'm using js inside a .NET CLI Jint program instead of a browser.) My problem is, I edit a XML using DOMImplementation.loadXML() function and then I edit one…
RandomGuy
  • 648
  • 6
  • 21
1
vote
1 answer

Run javascript from C# with Jint/Trap console.log calls

I'm using JINT to load a javascript file into a small C# app and call a number of methods with some parameters from C#. I want to get the return values of those methods. This is what I'm doing: JintEngine engine = new JintEngine(); …
user971580
0
votes
1 answer

C# SecurityException when reading text file

I'm writing a c# program (An IRC bot to be specific) and using the scripting library Jint ( http://jint.codeplex.com/ ). I have an external comamnd linked into it that when called reads a .js text stream from a different file. Reading the first…
user890704
0
votes
0 answers

How to get a local variable value (inside a function) with Jint?

In C# and using Jint, how can I get value of a local defined variable in a JavaScript function? For example, I have the following JavaScript code in the string "testStr". And I can't modify JS code as it is dynamic and not generated by me. var…
Hamid Z
  • 180
  • 1
  • 14
0
votes
0 answers

Create chart on canvas in JINT in c#

Thanks in advance.. I am creating a pdf from html using iText7 and in that html I am creating a chart on canvas with chart.js. All these are in memory in c# service where I can not use Chrome or any browser library with selenium. I want to generate…
Sachin
  • 2,152
  • 1
  • 21
  • 43
0
votes
0 answers

programmatically create JavaScript and save it to .js file using Jint in C#

I am working on a project where it requires to parse large numbers of .js files and programmatically update JavaScript code and save it to the same location from where it is loaded. Is this possible to do this using the Jint Engine and…
Sundaram
  • 11
  • 1
0
votes
0 answers

Pausing execution of a Jint engine without using multithreading

I have several Jint engines running different scripts. Sometimes I need to pause their execution and resume it later. My solution at the moment is to run each engine in its own thread and then use ManualResetEvent or similar to pause them as needed.…
Saturn
  • 17,888
  • 49
  • 145
  • 271
0
votes
1 answer

Is there a Valid way to run node modules from C# Class

Is there a Valid way to run node modules from C# Class ? There are some options which I know Use JS/TS to execute node module and host it in node API. Call that node API from c#. Use command prompt/Powershell to execute node script and run…
0
votes
0 answers

Access com interop objects through jint

We are looking at implementing Jint in our .net application and it looks to be a great solution. The issue we are facing is how jint access objects from com where .net has created a com wrapper around the objects. When we look at the objects in…
matvdl
  • 63
  • 4
0
votes
0 answers

Converting ES6 code to ES5 with Webpack and Babel to use it with Jint

I want to convert and pack ES6 javascript code to ES5 with Webpack and Babel to use it with Jint. This is my example ES6 code (index.js) : const hello = () => { return "Hello from JS ES6 file!"; }; console.log(hello()); This is package.json : …
user1579019
  • 455
  • 1
  • 7
  • 19
0
votes
1 answer

Can source generators be used instead of JINT?

We are exploring JINT and we were able to map a runtime custom javascript with C# methods. However, I was just being curious, can this same be achieved using a .net 6 source generators ? For instance, if there is a javascript method written, can…
Praneet Nadkar
  • 823
  • 7
  • 16
0
votes
1 answer

Pass js object to C# function

I'm trying out Jint and want to implement the fetch api to use from js. The second argument is a nested js object that is passed in: fetch('https://example.com', { method: 'post', headers : { authorization : 'xyz' } }); What is the…
gjvdkamp
  • 9,929
  • 3
  • 38
  • 46
0
votes
1 answer

Implementing require in the absence of node

Modules generally start something like this (function(root, factory) { /* globals define */ if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define([], factory); } else if…
Peter Wone
  • 17,965
  • 12
  • 82
  • 134
0
votes
1 answer

Editing .js with Jint

I am trying to edit the below javascript with jint. I really only want to edit var antiCapthaPredefinedApiKey = ''; and set the proxy settings in defaultConfig while at runtime. I have a winforms, I will be passing the two values into the method I…