JSPM

@pearl-framework/core

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q49005F

Pearl.js core — IoC container, application kernel, service providers

Package Exports

  • @pearl-framework/core

Readme

@pearl-framework/pearl

Batteries-included meta-package for Pearl.js — install once, get everything.

npm

Installation

npm install @pearl-framework/pearl drizzle-orm zod dotenv

Usage

Everything Pearl exports is available from a single import:

import {
  // Application
  Application,
  ServiceProvider,

  // HTTP
  Router,
  HttpKernel,
  HttpContext,

  // Auth
  AuthManager,
  JwtGuard,
  Hash,
  Authenticate,

  // Validation
  FormRequest,
  ValidationPipe,
  rules,
  z,

  // Database
  DatabaseManager,
  Model,
  pgTable, serial, varchar, timestamp,
  eq, and, or, desc, asc, sql,

  // Events
  Event,
  Listener,
  EventDispatcher,

  // Queues
  Job,
  QueueManager,

  // Mail
  Mailable,
  Mailer,
  LogTransport,
} from '@pearl-framework/pearl'

Minimal example

import 'dotenv/config'
import { Application, Router, HttpKernel } from '@pearl-framework/pearl'
import { AppServiceProvider } from './providers/AppServiceProvider.js'

const app = new Application({ root: import.meta.dirname })
app.register(AppServiceProvider)
await app.boot()

const router = new Router()
router.get('/', (ctx) => ctx.response.json({ message: 'Hello from Pearl 🦪' }))

await new HttpKernel().useRouter(router).listen(3000)

Or scaffold a full project:

npx @pearl-framework/cli new my-app
cd my-app
npm run dev

What's included

Export Source
Application, ServiceProvider, Container, Config, env @pearl-framework/core
Router, HttpKernel, HttpContext, Request, Response, Pipeline @pearl-framework/http
FormRequest, ValidationPipe, validate, validateSync, rules, z @pearl-framework/validate
AuthManager, JwtGuard, ApiTokenGuard, Hash, Authenticate, OptionalAuth @pearl-framework/auth
Event, Listener, EventDispatcher @pearl-framework/events
Job, QueueManager, QueueWorker @pearl-framework/queue
Mailable, Mailer, SmtpTransport, SesTransport, LogTransport, ArrayTransport @pearl-framework/mail
DatabaseManager, Model, Migrator, pgTable, eq, and, sql, desc, ... @pearl-framework/database

Using packages individually

If you only need specific features, install the packages directly:

npm install @pearl-framework/core @pearl-framework/http

See the Pearl.js monorepo for each package's documentation.