requestcodegen
requestcodegen copied to clipboard
A library to generate HTTP client example code in different programming languages.
requestcodegen
requestcodegen
is a library to generate HTTP client example code in different programming languages.
Install
npm install requestcodegen --save
Use
Using the library is as easy as:
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:
- Bump the version property in the
package.json
file. - Run
npm run prepare
. - Run
npm publish
.
Generate code
OPENAI_MODEL=<model> OPENAI_BASE_URL="<OpenAI API base URL>" OPENAI_API_KEY="OpenAI API key" npm run generate src/generators
Known usages
A few examples of how the library is used:
- ScreenshotOne 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.