Pythe1337N / garmin-connect

Makes it simple to interface with Garmin Connect to get or set any data point.
MIT License
144 stars 58 forks source link

Recommendation for developers: Use ChatGPT for generating types & readme docs #72

Open gregegan opened 9 months ago

gregegan commented 9 months ago

To generate types Drop in the entire api response from garmin connect, and ask chat gpt to generate you types for it! so fast.

To generate readme docs

Drop this example in, along with your function code and ask chat gpt to create developer readme docs in the same format as this for your function.

### `getDailyWeight(date?: Date): Promise<number>`

Retrieves the daily weight and converts it from grams to pounds.

#### Parameters:

-   `date` (Date, optional): Date of information requested. Defaults to the current date.

#### Returns:

-   `Promise<number>`: A Promise that resolves to the daily weight converted from grams to pounds.

#### Throws:

-   `Error`: If valid daily weight data cannot be found for the specified date.

#### Example:

```js
const weightInPounds = await instance.getDailyWeight(new Date('2023-12-25'));
console.log(`Daily weight on 2023-12-25: ${weightInPounds.toFixed(1)} lbs`);