Skip to content

Faking this and require (and similar) #538

Answered by ClearScriptLib
MikeCheel asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MikeCheel,

A quick look at bluebutton.js reveals that it's designed to work in the browser and in Node.js. In addition to the standard JavaScript built-ins, those environments provide extensive APIs, making many such libraries difficult to run in an application scripting environment.

However, this particular library only depends on xmldom, which has no dependencies, and ejs, which appears to be optional. It's therefore relatively easy to get it working in ClearScript.

First, let's set up the basics:

using var engine = new V8ScriptEngine();
engine.AddHostType(typeof(Console));

Next, let's bring in xmldom. To do that, we can simply npm install it in the application directory. One wrinkl…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MikeCheel
Comment options

You must be logged in to vote
3 replies
@ClearScriptLib
Comment options

@MikeCheel
Comment options

@ClearScriptLib
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants