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

access-matrix

v0.1.2

Published

A flexible and extensible access control library for Node.js applications, currently supporting SQLite with a clean, type-safe API. Designed to be easily extensible for additional database backends in the future.

Readme

Access Matrix

npm version npm downloads GitHub stars GitHub license Build Status

A lightweight, type-safe access control library for Node.js with SQLite and PostgreSQL support.

Features

  • 🔒 Role-based and permission-based access control
  • 🛠️ Extensible adapter architecture
  • 🚀 Built with TypeScript for better developer experience
  • ⚡ Simple and intuitive API
  • 🗄️ Database Support:
    • ✅ SQLite (built-in)
    • ✅ PostgreSQL
    • 📅 Auto-loading routes from source code

Installation

npm install access-matrix
# or
yarn add access-matrix

Quick Start

TypeScript

import AccessControl, { RouteData } from 'access-matrix';

interface AppRoute extends RouteData {
  requiresAuth?: boolean;
}

const ac = await AccessControl.create<AppRoute>({
  type: 'sqlite',
  database: './access.db'
});

Auto-Loading Routes

The access-matrix library can automatically detect and load routes from your source files.

Configuration

Create config/database.json:

{
  "database": {
    "type": "sqlite",
    "config": {
      "sqlite": {
        "mode": "file",
        "file_name": "access-matrix.db"
      }
    }
  },
  "route": {
    "loading": "auto",
    "auto": {
      "directories": ["src/routes", "api", "controllers"],
      "patterns": ["**/*.ts", "**/*.js"],
      "recursive": true,
      "exclude": ["node_modules", "*.test.*"]
    }
  }
}

Usage

import { AccessControl, loadRoutes } from 'access-matrix';

async function setupAccessControl() {
  const configPath = './config/database.json';
  const accessControl = await AccessControl.create(configPath);
  
  // Auto-load routes from configured directories
  const routes = await loadRoutes(configPath);
  
  console.log(`Found ${routes.length} routes:`);
  routes.forEach((route, index) => {
    console.log(`${index + 1}. ${route.method} ${route.path}`);
  });
  
  // Sync routes to database
  const syncResult = await accessControl.syncRoutes(routes);
  console.log(`Synced: ${syncResult.added} added, ${syncResult.removed} removed`);
  
  return accessControl;
}

Supported Frameworks

  • Express.js - router.get(), router.post(), etc.
  • Fastify - fastify.get(), fastify.post(), etc.
  • NestJS - @Get(), @Post(), @Put() decorators
  • Koa.js - router.get(), router.post(), etc.

See Route Patterns Documentation for detailed examples.

Documentation

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run examples
npm run example
npm run example:postgres
npm run example:autoload

📝 Reviews & Feedback

We'd love to hear your feedback! Help us improve access-matrix:

🌟 Rate This Package

📋 Quick Review Form

Copy this template and share your experience:

## Review: access-matrix

**⭐ Rating:** ★★★★★☆ (1-5 stars)

**🚀 Use Case:** What are you using it for?
- [ ] Role-based access control
- [ ] API route protection  
- [ ] Database permissions
- [ ] Auto-loading routes
- [ ] Other: _________

**✅ What Works Well:**
- 
- 

**💡 Suggestions for Improvement:**
- 
- 

**🔧 Technical Details:**
- Node.js version: _________
- Database: [ ] SQLite [ ] PostgreSQL [ ] Other
- TypeScript: [ ] Yes [ ] No

**📝 Overall Experience:**
_______________________________________________________

🎯 How to Share Your Review

  1. GitHub Issue: Use the template above in Issues
  2. GitHub Discussion: Start a Discussion
  3. Detailed Template: See REVIEW_TEMPLATE.md for comprehensive feedback

📊 Review Analytics

We track all feedback to improve access-matrix:

  • Ratings help us know what we're doing right
  • 🐛 Bug reports get immediate attention
  • 💡 Suggestions shape future development
  • 📝 Documentation feedback improves examples

🙏 Thank You!

Your feedback helps us improve access-matrix for everyone! 🚀

📝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT