fatsecret.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

fatsecret.js Logo

Github       Docs


Fatsecret.js is an unofficial API wrapper for the FatSecret nutrition database.

Highlights

  • ✔ Full OAuth2 support
  • ✔ Fully defined types
  • ✔ Classes & helper methods for responses
  • ✔ Automatic access token refreshing

Installation

# npm
npm install --save-dev fatsecret.js

# yarn
yarn add fatsecret.js

Basic Usage

Simple example of getting a food with id 1234 and logging it to the console.

// initialize new client
const client = new FatSecret.Client({
  credentials: {
    clientId: 'fatsecret client id',
    clientSecret: 'fatsecret client secret',
    scope: ['premier', 'barcode'], // your scopes
  },
});

// get food with id
const foundFood = await client.getFood({ foodId: '1234' });

console.log(foundFood); // Food {id: '1234'...}

📌 Only 4 food related methods currently supported.

Readme

Keywords

none

Package Sidebar

Install

npm i fatsecret.js

Weekly Downloads

13

Version

1.0.9

License

MIT

Unpacked Size

49.7 kB

Total Files

28

Last publish

Collaborators

  • badusername420