Commit 6169ab74 authored by Jerome Wu's avatar Jerome Wu

Add tools to convert bin to js

parent 4a572a82
const fs = require('fs');
const [,, iFileName, varName, oFileName] = process.argv;
const data = fs.readFileSync(iFileName, { encoding: 'base64' });
const out = `
const ${varName} = '${data}';
if (typeof module !== 'undefined') {
module.exports = ${varName};
}
`.trim('\n');
fs.writeFileSync(oFileName, out);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment