mirror of
https://github.com/codeninjasgg/code-sensei.git
synced 2024-11-23 15:57:55 -05:00
13 lines
458 B
JavaScript
13 lines
458 B
JavaScript
const fs = require("fs");
|
|
const bookmarklet = require("bookmarklet"); // https://github.com/mrcoles/bookmarklet
|
|
|
|
fs.readFile("./app.js", "utf8", (error, content) => {
|
|
if (error !== null) {
|
|
throw new Error(error);
|
|
}
|
|
const { code, options } = bookmarklet.parseFile(content);
|
|
const dist = bookmarklet.convert(code, options);
|
|
fs.writeFile("bookmarklet.txt", dist, undefined, () => {
|
|
console.log(`Here is your bookmarklet:\n${dist}`);
|
|
});
|
|
});
|