bookmarklets-cli
Version:
CLI for [bookmarklets](https://en.wikipedia.org/wiki/Bookmarklet) development
46 lines (31 loc) • 1.18 kB
Markdown
CLI for [bookmarklets](https://en.wikipedia.org/wiki/Bookmarklet) development
```bash
npx bookmarklets-cli [...]
npm install --save bookmarklets-cli
yarn add bookmarklets-cli
```
```bash
npx bookmarklets-cli script.ts
npx bookmarklets-cli 'src/*.ts'
npx bookmarklets-cli --dist-dir 'out'
```
In dev mode, every time the input script is saved, the CLI transpiles the input script and copies it to the clipboard.
Note that the leading `j` is removed (e.g., `avascript:(()=>{})` instead of `javascript:(()=>{})`). Many browsers automatically remove the `javascript:` part from URLs pasted into the address bar to enhance security, so the leading `j` is removed to avoid this issue.
When testing the copied output from dev mode in a browser, first type `j` in the address bar, then paste the copied output, and press Enter to execute it.
```bash
npx bookmarklets-cli --watch script.ts
npx bookmarklets-cli --watch 'src/*.ts'
```