Installation
Install AzuraJS in your project
Installation π¦
Get started with AzuraJS by installing it in your Node.js or Bun project.
Prerequisites β
Before installing AzuraJS, make sure you have:
- Node.js 18+ or Bun 1.0+
- TypeScript 5.0+ (recommended)
- A package manager: npm, yarn, pnpm, or bun
Installation Methods
Using npm
npm install azurajsUsing Yarn
yarn add azurajsUsing pnpm
pnpm add azurajsUsing Bun
bun add azurajsTypeScript Configuration π§
AzuraJS requires experimental decorators to be enabled. Update your tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}Key Configuration Options
experimentalDecorators: Enables TypeScript decorators support (required for @Controller, @Get, etc.)
emitDecoratorMetadata: Enables metadata reflection (recommended for advanced features)
Project Setup ποΈ
Create a new project structure:
mkdir my-azura-app
cd my-azura-app
npm init -y
npm install azurajsCreate basic files:
my-azura-app/
βββ src/
β βββ index.ts
β βββ controllers/
β βββ AppController.ts
βββ azura.config.ts
βββ tsconfig.json
βββ package.jsonVerify Installation βοΈ
Create a simple test file to verify everything is working:
import { AzuraClient } from "azurajs";
const app = new AzuraClient();
console.log("β
AzuraJS installed successfully!");Run it:
# With Node.js
npx tsx src/index.ts
# With Bun
bun run src/index.tsIf you see the success message, you're ready to go! π
Development Dependencies (Optional) π
For a better development experience, consider installing:
# TypeScript and type definitions
npm install -D typescript @types/node
# Development server with hot reload
npm install -D tsx nodemon
# or use Bun's built-in watch mode
bun --watch src/index.tsNext Steps π
Now that AzuraJS is installed, you're ready to:
Quick Start
Build your first API
Configuration
Configure your application
Controllers
Learn about controllers
Troubleshooting π
Decorator Errors
If you get errors about decorators not being recognized:
- Make sure
experimentalDecoratorsis enabled intsconfig.json - Verify you're using TypeScript 5.0 or higher
- Check that your editor is using the workspace TypeScript version
Import Errors
If you can't import from azurajs:
- Verify the package is installed:
npm list azurajs - Try deleting
node_modulesand reinstalling - Clear your TypeScript cache:
rm -rf .tsbuildinfo
Type Errors
For type-related issues:
- Make sure
@types/nodeis installed - Set
"moduleResolution": "bundler"or"node16"in tsconfig - Enable
esModuleInteropandskipLibCheck
Need help? Check our GitHub Issues or start a Discussion!
