Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@neos21/bookmarkletify

0.0.3 • Public • Published

Bookmarkletify : @neos21/bookmarkletify

NPM Version GPR Version

JavaScript コードを Bookmarklet 形式に圧縮・変換します。

CLI Usage

$ npm install -g @neos21/bookmarkletify
 
$ bookmarkletify --input ./my-file.js
$ bookmarkletify "console.log('Test');"

API Usage

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);
}

Author

Neo

Links

Keywords

none

Install

npm i @neos21/bookmarkletify

DownloadsWeekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

8.06 kB

Total Files

10

Last publish

Collaborators

  • avatar