multi-l
v1.0.1
Published
A Node.js package for translating code snippets between JavaScript and Python.
Readme
Multi-language Code Translator
A Node.js package for translating code snippets between JavaScript and Python.
Installation
npm install multi-language-code-translatorUsage
const CodeTranslator = require('multi-language-code-translator');
const jsCode = `
function greet(name) {
return 'Hello, ' + name + '!';
}
console.log(greet('world'));
`;
CodeTranslator.translateToPython(jsCode)
.then(pyCode => {
console.log('Python Code:');
console.log(pyCode);
return CodeTranslator.translateToJavaScript(pyCode);
})
.then(translatedJsCode => {
console.log('Translated JavaScript Code:');
console.log(translatedJsCode);
})
.catch(error => {
console.error('Translation error:', error);
});License
This project is licensed under the MIT License - see the LICENSE file for details.
