@deeplx/core
Version:
An unofficial but powerful and easy-to-use yet free DeepL API client for Node.js using [DeepL](https://www.deepl.com) by porting [OwO-Network/DeepLX](https://github.com/OwO-Network/DeepLX).
9 lines • 364 B
JavaScript
import { translateByDeepLX } from "./translate.js";
export const translate = async (text, targetLang, sourceLang, formal) => {
const result = await translateByDeepLX(sourceLang, targetLang, text, formal);
if ('message' in result) {
throw new Error(result.message, { cause: result });
}
return result.data;
};
//# sourceMappingURL=api.js.map