Skip to content

This is a TypeScript and JavaScript-based library that utilizes the OpenAI API to convert code from one selected language to another, such as class, interface, record, etc.

License

Notifications You must be signed in to change notification settings

alfredoaguiararce/CodeSwapCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeSwapCore

https://img.shields.io/badge/License-MIT-yellow.svg

https://img.shields.io/badge/TypeScript-Ready-blue.svg

https://img.shields.io/badge/JavaScript-ES5-yellow.svg

CodeSwapCore is a TypeScript and JavaScript-based library that utilizes the OpenAI API to convert code from one programming language to another. It supports various code patterns such as class, interface, record, and more.

Installation

npm install codeswapcore

Usage

Please note that you should replace 'YOUR_OPENAI_API_KEY' with your actual OpenAI API key.

import { TranformCode, ConfigureKey, CodePatterns } from 'codeswapcore';
import { ProgrammingLanguages } from 'codeswapcore';

// Configure your OpenAI API key
ConfigureKey('YOUR_OPENAI_API_KEY');

// Define your initial code and specify the target language and code pattern
const initCode = `...`;
const targetLanguage = ProgrammingLanguages.Ruby;
const pattern = CodePatterns.Class;

// Transform the code
TranformCode(initCode, targetLanguage, pattern)
  .then(newCode => {
    console.log('Transformed code:', newCode);
  })
  .catch(error => {
    console.error('Error:', error);
  });

License

CodeSwapCore is released under the MIT License.

Contributing

If you want to contribute to the project, you can do the following:

  • Report bugs or suggest improvements using the GitHub issues system.
  • Propose new features or improve documentation using pull requests.

License

This project is distributed under the MIT license. See the LICENSE file for more details.

If you find useful, consider supporting the project by making a donation via PayPal:

Support in Paypal ♥️

About

This is a TypeScript and JavaScript-based library that utilizes the OpenAI API to convert code from one selected language to another, such as class, interface, record, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published