環境
- node.js 12.14.0
ソース
{
"scripts": {
"nandoku": "javascript-obfuscator"
},
"dependencies": {
"javascript-obfuscator": "^0.25.4"
}
}
console.log('helloworld');
コマンド
$ npm i
$ npm run nandoku index.js
index-obfuscated.jsが作成される。
var a0_0x6fcc=['log'];(function(_0x9ce000,_0x6fcc31){var _0x528d7f=function(_0x11d980){while(--_0x11d980){_0x9ce000['push'](_0x9ce000['shift']());}};_0x528d7f(++_0x6fcc31);}(a0_0x6fcc,0x8d));var a0_0x528d=function(_0x9ce000,_0x6fcc31){_0x9ce000=_0x9ce000-0x0;var _0x528d7f=a0_0x6fcc[_0x9ce000];return _0x528d7f;};console[a0_0x528d('0x0')]('helloworld');
index-obfuscated.jsをnode.jsで実行してみる。
$ node index-obfuscated.js
helloworldが出力される。