# flower-nodejs-client **Repository Path**: mirrors_Orange-OpenSource/flower-nodejs-client ## Basic Information - **Project Name**: flower-nodejs-client - **Description**: Adaptation of the Python client of the Flower library in NodeJs - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-16 - **Last Updated**: 2025-10-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Flower NodeJs Client Package that allows you to implement a [Flower](http://flower.dev) client in NodeJs in order to create [federated learning](https://en.wikipedia.org/wiki/Federated_learning) with [tensorflow.js](https://js.tensorflow.org/api/latest/). ## Prerequisite Install : - python >= 3.6 - flower library : `pip install flwr` - nodejs - npm ## How to use Same usage as the Python version.
Create a client that override the client class and fill the 4 methods, like "example/tfjs_Client.js".
```javascript const {Client} = require('flower-client'); class Tfjs_Client extends Client{ ... } ``` Modify if necessary the "server.py" and run it.
Finally, run the clients by using start_tfjs_client. ```javascript const {start_tfjs_client} = require('flower-client'); const tfjs_client = new Tfjs_Client(); await start_tfjs_client(':', tfjs_Client,); ``` ## Run the example - Clone [repository](https://github.com/Orange-OpenSource/flower-nodejs-client) - Get into the folder : `cd ` - Installation: `npm i` - Get into the folder example: `cd example` - Run the server : `python server.py` - Run client#1 : `node index.js` - Run client#2 : `node index.js`