CyberChef/src/node/index.mjs

40 lines
822 B
JavaScript
Raw Normal View History

2018-03-27 00:14:23 +02:00
/**
* 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};