Extension-JSE
JavaScript Encrypt Extensions. Protect your code in the process of copying.
install
npm i extension-jse
npm i -g extension-jse
Usage
cli
$ export JSE_KEY=<secret-key>
$ jse <src/code.js> [output/]
in code
Pack your code
const jse = require('jse');
let originCode = 'your-code';
jse.pack(originCode);
let jsePackage = jse.packFromFile(__dirname +'path/to/code.js');
jse.writeToFile(__dirname + '/jse/code.jse', jsePackage);
Use jse
const jse = require('jse');
jse.enableExtension();
var code = require("./jse/code[.jse]");
$ export JSE_KEY=<secret-key>
$ node your-porject.js
npm script
"scripts": {
"build": "jse <src/code.js> [output/]",
}
$ export JSE_KEY=<secret-key>
$ npm run build