@aristech-org/nlp-client
Version:
A Node.js client library for the Aristech NLP Service
14 lines (11 loc) • 461 B
text/typescript
import 'dotenv/config'
import { NlpClient } from '@aristech-org/nlp-client'
const auth = process.env.TOKEN && process.env.SECRET ? { token: process.env.TOKEN, secret: process.env.SECRET } : undefined
const client = new NlpClient({
host: process.env.HOST,
ssl: Boolean(auth) || Boolean(process.env.ROOT_CERT) || process.env.SSL === 'true',
rootCert: process.env.ROOT_CERT,
auth,
})
const functions = await client.listFunctions()
console.log(functions)