0.1.3 • Published 1 year ago

nest-translate v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

NESTJS TRANSLATE

基于 Nest 封装的翻译 API,目前支持百度翻译和有道翻译,持续更新中。

使用

导入模块:

import { TranslateBaiduModule } from 'nest-translate'

@Module({
  imports: [
    TranslateBaiduModule.forRoot({ appid: '', secret: '' })
  ]
})

使用:

import { TranslateBaiduService } from 'nest-translate'

@Injectable()
export class UserService {
  constructor(private readonly translateBaiduService: TranslateBaiduService) {}
}

当成工具类使用:

import { TranslateBaiduService } from 'nest-translate'

const translate = new TranslateBaiduService({ appid: '', secret: '' })

使用文档

License

MIT