mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
Converted the core to ES modules
This commit is contained in:
parent
c1bb93eec1
commit
9b4fc3d3aa
154 changed files with 1901 additions and 2223 deletions
39
src/node/index.mjs
Normal file
39
src/node/index.mjs
Normal file
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* Node view for CyberChef.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import "babel-polyfill";
|
||||
|
||||
// Define global environment functions
|
||||
global.ENVIRONMENT_IS_WORKER = function() {
|
||||
return typeof importScripts === "function";
|
||||
};
|
||||
global.ENVIRONMENT_IS_NODE = function() {
|
||||
return typeof process === "object" && typeof require === "function";
|
||||
};
|
||||
global.ENVIRONMENT_IS_WEB = function() {
|
||||
return typeof window === "object";
|
||||
};
|
||||
|
||||
import Chef from "../core/Chef";
|
||||
|
||||
const CyberChef = {
|
||||
|
||||
bake: function(input, recipeConfig) {
|
||||
this.chef = new Chef();
|
||||
return this.chef.bake(
|
||||
input,
|
||||
recipeConfig,
|
||||
{},
|
||||
0,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
export default CyberChef;
|
||||
export {CyberChef};
|
Loading…
Add table
Add a link
Reference in a new issue