This repository was archived by the owner on Dec 29, 2022. It is now read-only.
bookmarkletify 0.0.4
Install from the command line:
Learn more about npm packages
$ npm install @neos21/bookmarkletify@0.0.4
Install via package.json:
"@neos21/bookmarkletify": "0.0.4"
About this version
JavaScript コードを Bookmarklet 形式に圧縮・変換します。
$ npm install -g @neos21/bookmarkletify
$ bookmarkletify --input ./my-file.js
$ bookmarkletify "console.log('Test');"
const bookmarkletify = require('@neos21/bookmarkletify');
const input = `javascript:
((doc) => {
let elem = doc.querySelector('#test');
if(elem) {
console.log(elem.value);
}
})(document);
`;
try {
const result = bookmarkletify(input);
}
catch(error) {
console.error(error);
}