node-fred
TypeScript icon, indicating that this package has built-in type declarations

2.1.10 • Public • Published

node-fred ·

build status npm version Coverage Status

A Fred2 API wrapper

The Fred API

Official Documentation

Wrapper Documentation

Installation Instructions

npm install node-fred --save

Example

Using Promises

import Fred from 'node-fred';

const fred = new Fred(API_KEY);

function getCategory(categoryID) {
    fred.categories
        .getCategory(125)
        .then((res) => {
            console.log('Category', res);
        })
        .catch((err) => {
            console.error('Error', err);
        });
}
getCategory(125);

Using async/await

import Fred from 'node-fred';

const fred = new Fred(API_KEY);

async function getCategory(categoryID) {
    try {
        const category = await fred.categories.getCategory(categoryID);
        console.log('Category', res);
    } catch (err) {
        console.error('Error', err);
    }
}
getCategory(125);

/node-fred/

    Package Sidebar

    Install

    npm i node-fred

    Weekly Downloads

    132

    Version

    2.1.10

    License

    MIT

    Unpacked Size

    128 kB

    Total Files

    15

    Last publish

    Collaborators

    • pastorsj