Skip to content
Lucas A. Ouverney edited this page Jan 16, 2025 · 5 revisions

Welcome to the jason wiki! πŸ“¦

Introduction

Overview

Jason is a tool for building local NoSQL databases with JSON πŸ˜‰. Built with TypeScript and zero dependencies, it generates collections and documents with built-in caching and UUID generation.

Key Features

  • πŸ”’ Type-safe collections and documents
  • πŸ“ Local JSON storage
  • πŸš€ Zero dependencies
  • πŸ’» Built with TypeScript
  • ⚑ Built-in document caching
  • 🎯 Automatic UUID generation
  • πŸ” Schema validation support

Getting Started

Installation

Choose your preferred package manager:

# Using bun
bun add -D @aurios/jason

# Using pnpm
pnpm add -D @aurios/jason

Basic setup

Define your interfaces (optional but recommended for type safety):

interface User {
  name: string;
  age: number;
  email: string;
}

interface Post {
  userId: string;
  content: string;
  postedDate: string;
  published: boolean;
}

interface IDatabase {
  user: User[];
  post: Post[];
}

Initialize your database:

// usually in 'src/db.ts'
import { JasonDB } from '@aurios/jason'

const db = new JasonDB<IDatabase>('my-awesome-database') // defaults to 'db'

Create collections

// Collections are fully typed based on your interfaces!
const userCollection = await db.collection('user')
const postCollection = await db.collection('post')

Documentation

For detailed information about working with collections and documents, check out:

  • Collections - Learn about CRUD operations, caching, and schema validation

Next Steps

After setting up your database and collections, you might want to:

  • Learn about collection operations
  • Set up schema validation
  • Configure metadata tracking
  • Explore caching options

For more detailed examples and API documentation, check out the other wiki pages.

Clone this wiki locally