npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

arango-typed

v1.6.3

Published

TypeScript-first ArangoDB ORM/ODM/OGM with Mongoose-like API, multi-tenancy, vector search, and Express-friendly integration

Readme

Arango Typed

ArangoDB ORM for TypeScript — Mongoose-like API, multi-tenancy, vector search, and OGM (graphs). Express-friendly and production-ready.

npm version npm downloads TypeScript License: MIT GitHub

Arango Typed is a comprehensive, type-safe ORM/ODM/OGM (Object Relational/Document/Graph Mapper) for ArangoDB that provides:

  • Full TypeScript Support - Type-safe from database to API
  • Express-friendly - Designed for Express.js with Mongoose-like API, works great with any Node.js framework
  • Complete ORM/ODM/OGM Features - Models, schemas, validations, hooks, relations, migrations, and awesome Object Graph Mapper with relationships, traversals, path queries, and graph algorithms
  • Graph Database Native - First-class support for edges, vertices, relationships, and graph patterns
  • Vector Search & AI - Built-in support for embeddings, RAG, and LangChain integration
  • Performance & Observability - Caching, profiling, metrics, and query optimization

🚀 Quick Start

Installation

npm install arango-typed arangojs

Basic Usage

import { connect, Schema, model } from 'arango-typed';

// Connect to ArangoDB (Mongoose-like API)
await connect('http://localhost:8529/myapp', { 
  username: 'root', 
  password: '' 
});

// Define Schema (Mongoose-like shorthand)
const userSchema = new Schema({
  name: String,                          // Simple shorthand
  email: { type: String, required: true, unique: true }, // With options
  age: Number,
  createdAt: { type: Date, default: () => new Date() }
});

// Create Model
const User = model('users', userSchema);

// Use the Model
const user = await User.create({
  name: 'John Doe',
  email: '[email protected]',
  age: 30
});

console.log(user.name); // TypeScript knows this is a string!

Multi-tenancy with Express

import express from 'express';
import { tenantMiddleware } from 'arango-typed/integrations/express';

const app = express();

// Extract tenant from header
app.use(tenantMiddleware({ extractFrom: 'header' }));

// Enable multi-tenancy on model
const User = model('users', userSchema, { tenantEnabled: true });

// Automatically filtered by tenant!
app.get('/users', async (req, res) => {
  const users = await User.find({}); // Only current tenant's users
  res.json(users);
});

See: Multi-tenancy Documentation for complete guide.


📚 Documentation

📖 Full HTML Documentation - Beautiful, interactive documentation with examples and guides

Core Features

Advanced Features

Integrations

API Reference


✨ Key Features

Type-Safe Development

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

const User = model<UserDoc>('users', userSchema);

// TypeScript knows the structure!
const user: UserDoc = await User.findById('123');
console.log(user.name); // ✅ Type-safe

Express-friendly Integration

Designed to work seamlessly with Express.js:

import express from 'express';
import { arangoMiddleware, tenantMiddleware } from 'arango-typed/integrations/express';

const app = express();

// ArangoDB middleware
app.use(arangoMiddleware({ database: db }));

// Multi-tenancy middleware
app.use(tenantMiddleware({ extractFrom: 'header' }));

// Works great with any Node.js framework too!

Awesome OGM (Object Graph Mapper) Support

import { GraphModel, graphModel, Graph, Edge } from 'arango-typed';

// Create a graph model (OGM pattern)
const UserGraph = graphModel(db, 'social_network', 'users', userSchema);

// OGM: Get connected vertices (like Neo4j OGM)
const friends = await UserGraph.getOutbound('users/alice', 'friends');
const followers = await UserGraph.getInbound('users/alice', 'follows');

// OGM: Create relationships
await UserGraph.createRelationship(
  'users/alice',
  'users/bob',
  'friends',
  { since: new Date(), weight: 1.0 }
);

// OGM: Get path between vertices
const path = await UserGraph.getPath('users/alice', 'users/charlie');

// Advanced: Graph traversals
const graph = new Graph(db, 'social_network');
const network = await graph.traverse({
  startVertex: 'users/alice',
  direction: 'outbound',
  depth: 3
});

Vector Search & AI

import { VectorSearch, ArangoRAG } from 'arango-typed';

// Vector similarity search
const results = await vectorSearch.similaritySearch(
  'documents',
  queryVector,
  { topK: 5 }
);

// RAG (Retrieval Augmented Generation)
const rag = new ArangoRAG(embeddings, db, {
  collectionName: 'documents'
});
const context = await rag.retrieve(query);

Complete ORM/ODM/OGM Features

A unified package combining document, relational, and graph capabilities:

  • Schema & Models - Schema definition with validation, Model classes with CRUD operations
  • Query Builder - Chainable AQL query builder with automatic caching
  • Relationships - HasOne, HasMany, BelongsTo, BelongsToMany, Polymorphic relations
  • Graph Models (OGM) - Graph models with relationship access (getOutbound, getInbound, getConnected)
  • Graph Operations - Native edge/vertex management, graph traversals (BFS/DFS, depth control)
  • Path Queries - Shortest path, all paths, k-shortest paths
  • Graph Algorithms - PageRank, centrality, community detection
  • Hooks & Middleware - Pre/post save, validate, init hooks
  • Virtual Fields - Computed properties and virtual fields
  • Indexes - Primary, unique, TTL, geo, fulltext indexes
  • Transactions - ACID transactions and bulk operations
  • Migrations - Up/down migrations with version control
  • Plugins - Extensible plugins system
  • Performance - Lean queries, query caching, compiled validators

🎯 Use Cases

  • Full-Stack Applications - Type-safe database access for Node.js/TypeScript apps
  • Graph Applications - Social networks, recommendation systems, knowledge graphs (with awesome OGM support!)
  • AI/ML Applications - RAG systems, vector search, embedding storage
  • Knowledge Graphs - Complex relationships with OGM patterns
  • Recommendation Systems - Graph-based recommendations with path queries
  • Social Networks - Friend networks, follows, connections with native graph support
  • Microservices - Multi-tenant applications with connection pooling
  • API Development - REST APIs with automatic CRUD routes
  • Real-time Applications - Change streams and live queries

📦 Installation

# Core package
npm install arango-typed arangojs



---

## 🔧 Configuration

**Mongoose-like Connection API:**

```typescript
import { connect } from 'arango-typed';

// Method 1: String format (Recommended)
await connect('http://localhost:8529/myapp', { 
  username: 'root', 
  password: '' 
});

// Method 2: Object format
await connect({
  url: 'http://localhost:8529',
  database: 'myapp',
  username: 'root',
  password: ''
});

// Method 3: Full options (backward compatible)
await connect({
  url: process.env.ARANGO_URL || 'http://localhost:8529',
  databaseName: process.env.ARANGO_DB || 'myapp',
  auth: {
    username: process.env.ARANGO_USER || 'root',
    password: process.env.ARANGO_PASS || ''
  }
});

Connections are automatically cached for performance!

See: Connection Management for detailed documentation.


📖 Examples

Express.js Integration

import express from 'express';
import { connect, model, Schema } from 'arango-typed';
import { arangoMiddleware, createArangoRoutes } from 'arango-typed';

await connect({ /* config */ });
const db = getDatabase();

const User = model('users', new Schema({
  name: String,
  email: String
}));

const app = express();
app.use(arangoMiddleware({ database: db }));
app.use(createArangoRoutes({
  database: db,
  models: { users: User }
}));

app.listen(3000);

Graph Database

import { Graph, Edge } from 'arango-typed';

// Create a graph
const graph = await Graph.create('social_network', {
  edges: [{
    collection: 'friends',
    from: ['users'],
    to: ['users']
  }]
});

// Add edges
await Edge.create('friends', {
  _from: 'users/alice',
  _to: 'users/bob',
  weight: 1.0
});

// Traverse graph
const path = await graph.shortestPath(
  'users/alice',
  'users/charlie'
);

Vector Search

import { VectorSearch } from 'arango-typed';

const vectorSearch = new VectorSearch(db);

// Store document with embedding
await vectorSearch.store('documents', {
  text: 'Hello world',
  embedding: [0.1, 0.2, 0.3, ...]
});

// Similarity search
const results = await vectorSearch.similaritySearch(
  'documents',
  queryVector,
  { topK: 5, scoreThreshold: 0.7 }
);

📄 License

MIT © Muhammed shafeeque P


🤝 Contributing

Contributions are welcome! Please read our Contributing Guide first.

See our Contributors page to see who has contributed to this project.


📞 Support


⭐ Features Overview

| Feature | Status | Description | |---------|--------|-------------| | TypeScript | ✅ | Full type safety | | ORM/ODM | ✅ | Mongoose-inspired API | | OGM | ✅ | Object Graph Mapper with relationship access | | Models & Schemas | ✅ | Document and graph models | | Query Builder | ✅ | Chainable AQL builder | | Relationships | ✅ | HasOne, HasMany, BelongsTo, etc. | | Graph Support | ✅ | Edges, traversals, algorithms, path queries | | Vector Search | ✅ | Embeddings and similarity | | Migrations | ✅ | Up/down migrations | | Caching | ✅ | In-memory and Redis | | Observability | ✅ | Profiling, metrics, logging | | Express Integration | ✅ | Express-friendly with middleware | | LangChain | ✅ | RAG and MCP integration |


Made with ❤️ for the ArangoDB community

arango-typed