Nested Parenthetical Madness

    @jych/gif-provider
    TypeScript icon, indicating that this package has built-in type declarations

    0.5.0 • Public • Published

    gif-provider

    pipeline status coverage report

    gif-provider is a JavaScript module that allows you to querying various gif APIs. Queries can be done to a single API at a time, or to multiple, with the results aggregated.

    The module currently supports fetching gifs from Giphy. Support for Tenor is in progress.

    You can easily extend gif-provider to support other APIs, either by contributing on GitLab, or by implementing your own GifProvider class.

    Installation

    npm install --save @jych/gif-provider

    Getting Started

    Installing

    In Node and CommonJS build systems:

    const {GifProviderFactory} = require('@jych/gif-provider');

    In ES6 Modules and Typescript:

    import {GifProviderFactory} from 'jych/gif-provider';

    Example Usage

    Querying Giphy:

    const {GiphyGifProvider} = require('@jych/gif-provider');
    
    const gifProvider = new GiphyGifProvider();
    
    gifProvider.search("rat mouse")
    .then( gifs => {
        // ...
    } );

    Querying multiple sites:

    const {CompositeGifProvider, GifProviderFactory} = require('@jych/gif-provider');
    
    const gifProvider =
    new CompositeGifProvider(GifProviderFactory.getProviders([ "giphy", "other", "foobar" ]));
    
    gifProvider.search("rat mouse")
     .then( gifs => {
         
         // gifs is a flat array of results from each site
         
         // ...
     } );

    Docs

    Full docs can be generated for offline use with:

    npm i @jych/gif-provider
    cd node_modules/@jych/gif-provider
    npm i
    npm run generate-docs
    cd docs
    open index.html 

    Install

    npm i @jych/gif-provider

    DownloadsWeekly Downloads

    2

    Version

    0.5.0

    License

    ISC

    Unpacked Size

    28.2 kB

    Total Files

    38

    Last publish

    Collaborators

    • jych