Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/29decibel/readability-cli
A readability cli/bun script to extract article from given URL, without NodeJS
https://github.com/29decibel/readability-cli
Last synced: 3 months ago
JSON representation
A readability cli/bun script to extract article from given URL, without NodeJS
- Host: GitHub
- URL: https://github.com/29decibel/readability-cli
- Owner: 29decibel
- Created: 2024-05-19T22:47:29.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-19T23:05:15.000Z (6 months ago)
- Last Synced: 2024-05-21T00:49:52.025Z (6 months ago)
- Language: TypeScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# readability-cli
This is to use `bun` and [mozilla/readability](https://github.com/mozilla/readability) to build a Node-free cli.
## Why
I really want to use the a high quality tool to extract article from given URL. [mozilla/readability](https://github.com/mozilla/readability) is one of them, however, I still want to use Elixir/Phoenix for my overall application system.
Thanks to [bun](https://bun.sh/), we can wrap the readability's `parse` call in a script without touching NodeJS at all.
Ultimately all we need is a `bun` binary. (Optionally another bun built script. Or go with compiled single executable).
## Development and usage
To install dependencies:
```bash
bun install
```Build the output
```bash
bun run build
```Test run
```bash
bun run test-run
```Get readability article JSON string
```bash
bun out/index.js https://github.com/mozilla/readability
```Build cli binary
```bash
bun run build:cli
```Using binary:
```bash
./readability-cli https://bun.sh/docs/bundler/executables
```