Skip to content

A library to generate HTTP client example code in different programming languages.

License

Notifications You must be signed in to change notification settings

krasun/requestcodegen

Repository files navigation

requestcodegen

Build NPM package

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:https://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.

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:

  1. 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.

About

A library to generate HTTP client example code in different programming languages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published