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

@irondome/core

v0.1.3

Published

Policy-based access control (PBAC) engine for Irondome

Readme

@irondome/core

Motor de autorização (PBAC, ReBAC, Audit) — sem acoplamento a frameworks.

Pilar: políticas e decisões de acesso. Produz PolicyResult a partir de Subject, Action e Resource.

Parte do monorepo Irondome — o mesmo espírito do README principal: quem decide o que cada pessoa pode fazer — o código ou a política?


O que é?

@irondome/core é o núcleo importável do Irondome: PBAC (funções de política), ReBAC (tuplas e checkRelation), hooks de auditoria, catálogo de roles/actions e helpers para páginas e painéis por posição (subject.attributes.position).

Não inclui HTTP nem UI — corre em testes, workers e qualquer runtime JS/TS.


Instalação

pnpm add @irondome/core

Dependências

Nenhuma em runtime — pacote standalone.


O que inclui

| Área | Conteúdo | |------|----------| | PBAC | PolicyEngine, createPermissions, tipos Subject, Resource, Action, Context | | Catálogo | Roles, actions, pageResource, namedResource, hasRole, hasEveryRole | | Painel / posição | PanelPosition, POSITION_RANK, hasMinimumPosition, panelResource, actions.panel.* | | ReBAC | MemoryRelationStore, checkRelation, RelationTuple, RelationStore | | Audit | AuditHook, createConsoleAuditHook, AuditEvent |


Exemplo rápido (PBAC)

import { createPermissions, actions, hasRole, Roles, type Policy } from "@irondome/core";

const pagePolicy: Policy = (subject, action, resource) => {
  if (resource.type !== "page" || action !== actions.page.visit) return null;
  if (resource.id.startsWith("/admin")) {
    return hasRole(subject, Roles.admin)
      ? { allowed: true, reason: "admin" }
      : { allowed: false, reason: "apenas admin" };
  }
  return null;
};

export const { can, authorize } = createPermissions({ policies: [pagePolicy] });

(Mesmo padrão do README do monorepo, secção PBAC.)


ReBAC e Audit

import { MemoryRelationStore, checkRelation } from "@irondome/core";
import { createPermissions, createConsoleAuditHook } from "@irondome/core";

const store = new MemoryRelationStore();
await checkRelation(store, "user:alice", "owner", "repo:api", { via: ["member"] });

export const { can } = createPermissions({
  policies: [/* ... */],
  audit: createConsoleAuditHook({ onlyDenied: false }),
});

Relação com outros pacotes

| Pacote | Função | |--------|--------| | @irondome/auth | Transforma login/sessão num Subjectnão substitui este motor | | @irondome/next | Liga can() a middleware, Route Handlers, tRPC e React |


Documentação

| Recurso | Ligação | |---------|---------| | Monorepo | README Irondome | | Quatro pilares | Guia dos pilares | | Publicar no npm | npm-publish |


Licença

MIT © rbxyz