1.0.1 • Published 4 years ago
simple-papago v1.0.1
simple-papago
간단한 papago 번역 라이브러리
사용 전
Papago 번역 애플리케이션 등록이 필요합니다.
여기 을 눌러 애플리케이션을 발급하세요
사용법
const {Papago, Code} = require('simple-papago');
const id = 'Client ID';
const secret = 'Client Secret';
const text = '안녕하세요';
// 동기
new Papago(id, secret).Translate(Code.ko, Code.en, text).then(json => {
console.log(json);
}).catch(error => {
console.log(error);
});
// 비동기
try {
const json = await new Papago(id, secret).Translate(Code.ko, Code.en, text);
console.log(json);
} catch (e) {
console.log(e);
}