mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-10 08:15:00 -04:00
use std/esm to make chef compatible with cjs projects. Remove webpack work for node
This commit is contained in:
parent
897dc0fb97
commit
e4d98eba6b
6 changed files with 27 additions and 54 deletions
36
src/node/repl.js
Normal file
36
src/node/repl.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* Create a REPL server for chef
|
||||
*
|
||||
*
|
||||
* @author d98762656 [d98762625@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
const chef = require("./cjs.js");
|
||||
const repl = require("repl");
|
||||
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
|
||||
console.log(`
|
||||
______ __ ________ ____
|
||||
/ ____/_ __/ /_ ___ _____/ ____/ /_ ___ / __/
|
||||
/ / / / / / __ \\/ _ \\/ ___/ / / __ \\/ _ \\/ /_
|
||||
/ /___/ /_/ / /_/ / __/ / / /___/ / / / __/ __/
|
||||
\\____/\\__, /_.___/\\___/_/ \\____/_/ /_/\\___/_/
|
||||
/____/
|
||||
|
||||
`);
|
||||
const replServer = repl.start({
|
||||
prompt: "chef > ",
|
||||
});
|
||||
|
||||
global.File = chef.File;
|
||||
|
||||
Object.keys(chef).forEach((key) => {
|
||||
if (key !== "operations") {
|
||||
replServer.context[key] = chef[key];
|
||||
}
|
||||
});
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue