{"id":19610746,"url":"https://github.com/onflow/flow-cadut","last_synced_at":"2025-08-09T21:20:19.496Z","repository":{"id":39036287,"uuid":"370278610","full_name":"onflow/flow-cadut","owner":"onflow","description":"Node based template generator to simplify interaction with Cadence files.","archived":false,"fork":false,"pushed_at":"2024-05-22T06:08:33.000Z","size":1358,"stargazers_count":21,"open_issues_count":22,"forks_count":12,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-13T19:12:32.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onflow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-24T08:19:01.000Z","updated_at":"2025-02-18T03:08:40.000Z","dependencies_parsed_at":"2024-05-20T22:53:26.909Z","dependency_job_id":"09b8fab7-c62a-48ae-8fb2-4082acf445f5","html_url":"https://github.com/onflow/flow-cadut","commit_stats":{"total_commits":175,"total_committers":12,"mean_commits":"14.583333333333334","dds":0.4057142857142857,"last_synced_commit":"4526772d45afe0e3770b107c21dcd9b7c41a89a9"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-cadut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-cadut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-cadut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-cadut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onflow","download_url":"https://codeload.github.com/onflow/flow-cadut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219600,"owners_count":21554444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:32:55.662Z","updated_at":"2025-04-27T22:33:00.038Z","avatar_url":"https://github.com/onflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flow Cadence Template Utilities\nFlow Cadut supports Cadence interaction by wrapping template files in Javascript.\n\nFlow Cadut (Flow Cadence Utilities) contains two core packages:\n  1. Flow Cadence Utilities (`@onflow/flow-cadut`)\n  2. Flow Cadence Template Generator (`@onflow/flow-cadut-generator`)\n\n## Flow Cadence Utilites: Flow Cadut\nThe Flow Cadence Utilities (`@onflow/flow-cadut`) package is the API responsible for parsing cadence templates, mapping arguments/imports to these templates, and interacting with the chain.  It is the set of runtime utilities which are used behind the scenes by the JavaScript template files generated by `@onflow/flow-cadut-generator`.\n\nFor more information, see the [README file](packages/flow-cadut/README.md).\n\nYou can find a list of available methods with examples at [API Documentation](/docs/api.md)\n\n## Flow Cadence Template Generator: Flow Cadut Generator\nThe Flow Cadence Template Generator (`@onflow/flow-cadut-generator`) is responsible for parsing Cadence (.cdc) template files and translating them to easy-to-use JavaScript (.js) files. The Cadence Template Generator, takes either path to a local folder or url to a Github repository and generates JavaScript files which wrap the Cadence code and facilitate sending the templated interactions to the Flow network.\n\n## Usage\n\n### Installation\n\nIn order to install the Flow Cadence Template Generator CLI, run the following command to add it to your project's `devDependencies`:\n\n```bash\nnpm install -D @onflow/flow-cadut-generator\n```\n\nNote that any generated code will require `@onflow/flow-cadut` as a dependency which can be installed by running the following command in your project root:\n\n```bash\nnpm install @onflow/flow-cadut\n```\n\n### CLI options\n```\nflow-generate [input] [output]\n\nGenerate corresponding JavaScript files from a cadence input folder\n\nOptions:\n      --help        Show help                                          [boolean]\n      --version     Show version number                                [boolean]\n  -i, --input       Cadence input directory or Github repository URL\n                                                 [string] [default: \"./cadence\"]\n  -o, --output      Javascript output directory\n                                           [string] [default: \"./src/generated\"]\n  -b, --branch      Git branch to use if git repository used as input   [string]\n  -d, --dependency  Dependency to use in generated templates\n                                        [string] [default: \"@onflow/flow-cadut\"]\n  -w, --watch       Whether to run the generator as a standalone build or in\n                    watch mode                        [boolean] [default: false]\n```\n\n### Local Folder\n```\n# long flags\nnpx flow-generate --input ./cadence --output ./src/generated\n\n# short flags\nnpx flow-generate -i ./cadence -o ./src/generated\n\n# no flags\nnpx flow-generate ./cadence ./src/generated\n```\n\n### GitHub Repository\nFor GitHub repositories you can specify branch you want to pull with `--branch` or `-b` flags. If you omit it, then generator\nwill default to `master/main` branch.\n```\n# long flags\nnpx flow-generate --input https://github.com/onflow/flow-core-contracts --branch feature/epochs --output ./src/generated\n\n# short flags\nnpx flow-generate -i https://github.com/onflow/flow-core-contracts -b feature/epochs -o ./src/generated\n\n# positional arguments\nnpx flow-generate https://github.com/onflow/flow-core-contracts ./src/generated -b feature/epochs\n\n# positional arguments, main branch\nnpx flow-generate https://github.com/onflow/flow-core-contracts ./src/generated\n```\n#### Process Single Folder (recursively)\nYou can also paste full path to specific folder that you want to process. For example:\n```\nnpx flow-generate https://github.com/onflow/flow-core-contracts/tree/master/contracts ./src/generated\n```\nIn this specific case, generator would assume that you want to process `contracts` folder in the root of repository.\n\nFor a slightly more complex case - using Git Flow approach for example - please, specify branch name, so generator can \nextract folder name properly.\n```\nnpx flow-generate https://github.com/onflow/flow-core-contracts/tree/feature/epochs/transactions/flowToken ./src/generated -b feature/epochs\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fflow-cadut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonflow%2Fflow-cadut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fflow-cadut/lists"}