Install
neuro-ts is published to npm. It ships ESM, CJS, an IIFE bundle for
direct script tags, and full TypeScript types.
$ npm install neuro-ts $ pnpm add neuro-ts $ yarn add neuro-ts $ bun add neuro-ts $ deno add npm:neuro-ts Peer requirements
Section titled “Peer requirements”| Runtime | Minimum |
|---|---|
| Node | 18.18 |
| Bun | 1.0 |
| Modern browsers | ES2022 |
The openai SDK is a runtime dependency. It is not bundled into the
ESM/CJS outputs (treeshaking-friendly). It is inlined into the IIFE
bundle so a single script tag works on a static page.
CDN (no build tool)
Section titled “CDN (no build tool)”<script src="https://unpkg.com/neuro-ts/dist/neuro-ts.iife.js"></script><script> NeuroTS.configureClient({ tokenProvider: () => fetch('/api/neuro-token').then((r) => r.text()), }); NeuroTS.neuro.array .map({ array: ['a', 'b'], callbackfn: (s) => s, prompt: 'uppercase each' }) .then(console.log);</script>Verify your install
Section titled “Verify your install”import { configureClient, neuro } from 'neuro-ts';
configureClient({ apiKey: process.env.OPENAI_API_KEY });console.log(await neuro.math.random({}));