Code Monkey home page Code Monkey logo

giph's Introduction

giph

npm package version Travis build status npm package downloads index.js file size code style license

A small node module/command line interface tool that fetches a random GIF from Giphy.

Installation/Usage

CLI

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.

Node

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)
  }
})

Options

  • 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)

CLI Only

  • --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.

License

MIT. See the License file for more info.

giph's People

Contributors

kodie avatar socalnick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

socalnick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.