sindresorhus / capture-website-cli

Capture screenshots of websites from the command-line
MIT License
821 stars 42 forks source link

Automatically create a file or smartly send the data to stdout when piped #36

Open caribpa opened 2 years ago

caribpa commented 2 years ago

Hi there!

I've been using this little tool lately and I wanted to contribute with some user-friendly improvements:

In a nutshell:

$ capture-website https://github.com/git               # Auto-creates github.com-git.png in current dir

$ capture-website https://goo.gl | open -f -a Preview  # Automatically pipes the data

$ echo "<h1>Unicorn</h1>" | capture-website            # Auto-creates stdin.png

$ capture-website /path/to/file.html --type=jpeg       # Auto-creates file.jpeg

$ capture-website file:///path/to/file.html            # Auto-creates path-to-file.html.png

$ capture-website file.html --output test.png          # Auto-creates test.png

$ capture-website file.html --output=-                 # Send the data to stdout

$ capture-website http://i.dont/exist                  # Gracefully exits with an error message

Let me know what you think 😊