https://github.com/junobuild/didc
A CLI tool for generating JavaScript or TypeScript content from a DID file
https://github.com/junobuild/didc
Last synced: 5 months ago
JSON representation
A CLI tool for generating JavaScript or TypeScript content from a DID file
- Host: GitHub
- URL: https://github.com/junobuild/didc
- Owner: junobuild
- License: mit
- Created: 2024-09-09T16:01:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-09T19:54:26.000Z (over 1 year ago)
- Last Synced: 2025-03-16T18:21:17.261Z (about 1 year ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JunoBuild-Didc
`junobuild-didc` is a CLI tool for generating JavaScript, TypeScript, or DID output from a Candid `.did` file using the [didc](https://github.com/dfinity/candid) tool.
This utility is designed to be integrated in Juno's CLI.
## Installation
You can install `junobuild-didc` globally using Cargo by running:
```bash
cargo install junobuild-didc
```
## Usage
You can use the `junobuild-didc` command to generate JavaScript or TypeScript bindings from a DID file.
```bash
junobuild-didc --input --target [--output ]
```
### Example
```bash
junobuild-didc --input ./path/to/interface.did --target ts --output ./generated/output.ts
```
- `--input` or `-i`: Path to the `.did` file.
- `--target` or `-t`: Choose either `js` for JavaScript or `ts` for TypeScript output.
- `--output` or `-o`: (Optional) Specify the output file. If omitted, the generated content will be printed to the console.
## Development
### Building from Source
If you want to build the tool from the source, you can clone the repository and build it yourself.
```bash
git clone https://github.com/junobuild/didc
cd didc
cargo build --release
```
Once built, the binary will be located in `target/release`. You can run it from the root directory:
```bash
./target/release/junobuild-didc --help
```
This will display the available commands and usage instructions.
### Running Tests
You can run the tests with:
```bash
cargo test
```
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.