https://github.com/krasun/requestcodegen
A library to generate HTTP client example code in different programming languages.
https://github.com/krasun/requestcodegen
code-generation codegenerator curl http http-client typescript-library
Last synced: 29 days ago
JSON representation
A library to generate HTTP client example code in different programming languages.
- Host: GitHub
- URL: https://github.com/krasun/requestcodegen
- Owner: krasun
- License: mit
- Created: 2024-01-05T07:06:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-08T19:32:41.000Z (about 1 month ago)
- Last Synced: 2025-04-19T11:23:29.407Z (29 days ago)
- Topics: code-generation, codegenerator, curl, http, http-client, typescript-library
- Language: TypeScript
- Homepage:
- Size: 218 KB
- Stars: 25
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# requestcodegen
[](https://github.com/krasun/requestcode/actions/workflows/build.yml)
[](https://www.npmjs.com/package/requestcodegen)`requestcodegen` is a library to generate HTTP client example code in different programming languages.
## Install
```shell
npm install requestcodegen --save
```## Use
Using the library is as easy as:
```typescript
import { generateCode } from "requestcodegen";const clojureCodeExample = generateCode(
{ url: "http://example.com", method: "POST" },
CodeTarget.Clojure
);
```## Build and publish (a manual for developers)
To build and publish the library:
1. Bump the version property in the `package.json` file.
2. Run `npm run prepare`.
3. Run `npm publish`.## Code Examples
Check out examples of generated code in the [examples.md](examples.md) file.
# Known usages
A few examples of how the library is used:
1. [ScreenshotOne](https://screenshotone.com) uses the library for generating code examples in the playground for the screenshot API.
If you use the library, please, don't hesitate to share how and in what project.
## License
`krasun/requestcodegen` is released under [the MIT license](LICENSE).