nest-translate
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

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

Package Sidebar

Install

npm i nest-translate

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

19.5 kB

Total Files

17

Last publish

Collaborators

  • wytxer