com.coveo.nashorn_modules.Require Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nashorn-commonjs-modules Show documentation
Show all versions of nashorn-commonjs-modules Show documentation
CommonJS modules implementation for Nashorn
package com.coveo.nashorn_modules;
import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.ScriptException;
import jdk.nashorn.api.scripting.NashornScriptEngine;
public class Require {
public static Module enable(NashornScriptEngine engine, Folder folder) throws ScriptException {
Bindings global = engine.getBindings(ScriptContext.ENGINE_SCOPE);
Module module = new Module(engine, folder, new ModuleCache(), "", global, null, null);
module.setLoaded();
return module;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy