1.0.2 • Published 12 months ago

@nitra/tfm-node v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@nitra/tfm-node

usage with node

ENV TFM

import tf from '@nitra/tfm-node'
import Fastify from 'fastify'

const fastify = Fastify()

const tr = {
  'Привіт Сонечко ': { en: 'Hello Sun ', lv: 'Sveika Saulīte ', ee: 'Tere Päike ' }
}

// Declare a route
fastify.post('/', {}, function (req, reply) {
  console.log(req.headers.lang)
  const t = tf.bind({ tr, lang: req.headers.lang })

  reply.send({ result: t`Привіт Сонечко ${Date.now()} without trans ${0}` })
})

// Run the server!
fastify.listen({ port: 3000 })
1.0.2

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago