This is the official JS/TS SDK for the Open Food Facts API.
npm install git+https://github.com/openfoodfacts/openfoodfacts-nodejs.git
# or
yarn add git+https://github.com/openfoodfacts/openfoodfacts-nodejs.git
# or
pnpm add git+https://github.com/openfoodfacts/openfoodfacts-nodejs.git
import OpenFoodFacts from "openfoodfacts-nodejs";
const client = new OpenFoodFacts();
client.getProduct("5000112546415").then((it) => console.log(it));
- Node.js
- Yarn v4
The project uses openapi-typescript to generate the API bindings automatically from the OpenAPI specification.
To generate the API bindings, run yarn api
.
The files are to be committed to the repository, so that the SDK can be used without having to download the specs every time.
- Clone the repository and run
yarn install
in the directory. - Run
yarn build
to generate the OpenAPI bindings and build the project. - Run
yarn test
to run the tests.
We accept contributions of any kind: new features, bug fixes, documentation improvements, etc.
You can also help us by reporting bugs, suggesting improvements or testing new features.
When submitting a PR, please use the angular commit guideline.
If you use this SDK, feel free to open a PR to add your application in this list.
- openfoodfacts-explorer : https://github.com/openfoodfacts/openfoodfacts-explorer