Socket
Socket
Sign inDemoInstall

fatsecret.js

Package Overview
Dependencies
19
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fatsecret.js

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


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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.

FAQs

Last updated on 02 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc