Merge branch 'use-std-esm' of github.com:gchq/CyberChef

This commit is contained in:
n1474335 2019-08-12 15:26:15 +01:00
commit 66b82598e3
10 changed files with 205 additions and 100 deletions

13
src/node/cjs.js Normal file
View file

@ -0,0 +1,13 @@
/**
* Export the main ESM module as CommonJS
*
*
* @author d98762656 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
/*eslint no-global-assign: ["off"] */
require = require("esm")(module);
module.exports = require("./index.mjs");
module.exports.File = require("./File.mjs");

View file

@ -7,9 +7,9 @@
* @license Apache-2.0
*/
import chef from "./index.mjs";
import repl from "repl";
import File from "./File.mjs";
const chef = require("./cjs.js");
const repl = require("repl");
/*eslint no-console: ["off"] */
@ -26,7 +26,7 @@ const replServer = repl.start({
prompt: "chef > ",
});
global.File = File;
global.File = chef.File;
Object.keys(chef).forEach((key) => {
if (key !== "operations") {