Skip to content

📦 Installation

⚡ Requirements

🚀 Installation

1
npm install acai-ts
1
yarn add acai-ts
1
pnpm add acai-ts

Note: reflect-metadata is automatically installed as a dependency of acai-ts.

🔧 TypeScript Configuration

Acai-TS requires the following TypeScript compiler options in your tsconfig.json:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "target": "ES2020",
    "module": "commonjs",
    "moduleResolution": "node",
    "esModuleInterop": true
  }
}

📋 Import Reflect Metadata

You must import reflect-metadata at the entry point of your application when using decorators:

1
2
3
4
import 'reflect-metadata';
import { Router, BaseEndpoint } from 'acai-ts';

// Your code here...

Important: While reflect-metadata is automatically installed with acai-ts, you still need to explicitly import it in your code for decorator support to work.

✅ Verify Installation

Create a simple test file to verify the installation:

1
2
3
4
5
6
7
8
import 'reflect-metadata';
import { Router } from 'acai-ts';

const router = new Router({
  basePath: '/api/v1'
});

console.log('Acai-TS installed successfully!');