Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gromnitsky/adieu
A command line interface to cheerio library; vaguely similar to nokogiri
https://github.com/gromnitsky/adieu
Last synced: about 6 hours ago
JSON representation
A command line interface to cheerio library; vaguely similar to nokogiri
- Host: GitHub
- URL: https://github.com/gromnitsky/adieu
- Owner: gromnitsky
- Created: 2019-03-10T18:44:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-03T07:43:57.000Z (over 5 years ago)
- Last Synced: 2024-11-10T21:02:50.595Z (9 days ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# adieu
A command line interface to [cheerio][] library; vaguely similar to
nokogiri; handy for shell scripts or makefiles.$ npm -g i adieu
~~~
$ adieu -h
Usage: adieu [options] [file.html | URL]Options:
-V, --version output the version number
-e, --evalJS
-p, --print automatically console.log the result form -e
-r, --require preload a module (default: [])
-R, --raw don't simplify printouts of cheerio/dom objects
-h, --help output usage information
~~~Print all image urls from google's front page:
~~~
$ adieu -pe '$("img").map((_,v)=>$(v).attr("src")).get().join`\n`' http://google.com
/images/branding/googlelogo/1x/googlelogo_white_background_color_272x92dp.png
/textinputassistant/tia.png
~~~Read html from the stdin:
~~~
$ curl -sL http://gnu.org | adieu -pe '$("h2").first().text()'
What is GNU?
~~~Load html into a repl:
~~~
$ adieu http://gnu.org
Your document should be available via $
> $('a').length
107
~~~## Helpers
| name | desc |
| --------- | ----------------------------------------------------------- |
| `cheerio` | |
| `$` | a cheerio instance w/ the loaded document |
| `p` | alias to `console.log` |
| `puts` | convert an arg to a string & write the result to the stdout |## License
MIT
[cheerio]: https://github.com/cheeriojs/cheerio