A small node module/command line interface tool that fetches a random GIF from Giphy.
npm install --global giph
giph <keywords> [--rating=r --file=~/Desktop/giph.gif --key=API_KEY --details --nodisplay --nocopy]
The CLI tool will attempt to display the GIF in the terminal (currently only supported by iTerm2 v3.0 or higher) and copy the URL to your clipboard.
npm install --save giph
const giph = require('giph')
// Promises
giph(keywords, options)
.then(img => {
console.log(img)
})
.catch(err => {
console.error(err)
})
// Callback
giph(keywords, options, (err, img) => {
if (err) {
console.error(err)
} else {
console.log(img)
}
})
- buffer - Set to true to also return the image as a buffer. (Defaults to false)
- file - File path to save the gif to. (Defaults to blank)
- key - Giphy API key. (Just in case you would like to use your own) (Defaults to blank)
- rating - Rating to limit the gif to (y, g, pg, pg-13, or r). (Defaults to blank)
- --details - Display the details returned from the API in the terminal.
- --nocopy - Don't copy the gif URL to the clipboard.
- --nodisplay - Don't display the gif in the terminal.
MIT. See the License file for more info.