jsfycat

1.0.2 • Public • Published

jsfycat

A Node.js wrapper for the Gfycat API using async/await functionality.

Installation

NPM

npm install jsfycat

Yarn

yarn add jsfycat

Usage

First, obtain a client ID and client secret from the Gfycat Developer Portal.

Store these client credentials in a secure location.

const GfycatClient = require("jsfycat");

async function main() {
  const gfycat = new GfycatClient({
    clientId: "clientId goes here",
    clientSecret: "client secret goes here.",
  });
}

main();

Methods

Authenticate

Returns an API access token, valid for 1 hour.

await gfycat.authenticate();

Get Gfycat Information

Returns a JSON containing information about a specified gfycat.

gfyInfo = await gfycat.getGfycatInfo("Gfyname goes here.");

Upload from URL

Uploads a remote file to Gfycat by specifying its URL.

urlUploadRes = await gfycat.uploadFromUrl("URL goes here.");

Upload from file

Uploads a local file to Gfycat.

fileUploadRes = await gfycat.uploadFromFile("Filepath goes here.");

Dependents (0)

Package Sidebar

Install

npm i jsfycat

Weekly Downloads

2

Version

1.0.2

License

GPL-3.0

Unpacked Size

42.5 kB

Total Files

6

Last publish

Collaborators

  • silverben10