@jakew/workout-converter
v2.3.0
Published
A workout data conversion tool.
Downloads
37
Readme
Workout Converter
A TypeScript library for converting strength training workout data between different apps and formats.
If you are looking to use the tool, you can use it here - all the conversion happens in your browser locally.
Formats
The following apps/formats are supported:
| Format | Description | | --- | --- | | NextRep | Convert workout and template data to and from NextRep's JSON format. | | NextRep (v1) | Convert workout and template data to and from the format used for version 1 of the NextRep app. | | Strong | Convert workout data to and from Strong's CSV format. Please note Strong does not support the export of templates, or importing data back into the app. | | Hevy | Convert workout data to and from Hevy's CSV format. Hevy does not support the export of templates and importing to Hevy requires a Strong CSV file. |
Install
# ✨ Auto-detect
npx nypm install @jakew/workout-converter
# npm
npm install @jakew/workout-converter
# yarn
yarn add @jakew/workout-converter
# pnpm
pnpm add @jakew/workout-converter
# bun
bun install @jakew/workout-converter
# deno
deno install npm:@jakew/workout-converterUsage
The premise is there are "adapters" for each app or format. When converting between two different formats, the data is converted using the "input adapter" to a common format, then a second "output adapter" converts the common format to it's format. Each adapter contains a method for converting from it's format to the common format, and vice-versa, creating import and export functions.
Use the getAdapterInfo() function to get a list of available adapters and descriptions. Then use the convertData() function to perform data conversion between two different formats.
ESM (Node.js, Bun, Deno)
import { getAdapterInfo, convertData } from "@jakew/workout-converter";CDN (Deno and Browsers)
import {
getAdapterInfo,
convertData,
} from "https://esm.sh/@jakew/workout-converter";Usage Example
// Convert from a Strong CSV to a NextRep JSON
await convertData(myBlob, "Strong", "NextRep");Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
🤖 auto updated with automd
