0.2.10 • Published 8 months ago

@cerbos/files v0.2.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

@cerbos/files

npm

Load Cerbos policies from YAML or JSON files.

Prerequisites

  • Node.js 18+

Installation

$ npm install @cerbos/files

Example usage

import { readDirectory, readPolicy, readSchema } from "@cerbos/files";

const policy = await readPolicy("path/to/policy.yaml");
// => { apiVersion: "api.cerbos.dev/v1", ... }

const schema = await readSchema("_schemas/path/to/schema.json");
// => { id: "path/to/schema.json", definition: "..." }

const { policies, schemas } = await readDirectory("path/to/directory");
// => { policies: [...], schemas: [...] }

For more details, see the package documentation.

Further reading

Get help

0.2.10

8 months ago

0.2.9

9 months ago

0.2.7

1 year ago

0.2.8

10 months ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago