danmindru / requestcodegen

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:TypeScript 99.9%Language:JavaScript 0.1%