Skip to content
Bookmarkletify
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
test
.gitignore
LICENSE
README.md
cli.js
main.js
package.json

README.md

Bookmarkletify : @neos21/bookmarkletify

NPM 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 (@Neos21)

Links

You can’t perform that action at this time.