Skip to content

Deno

Layerfig is compatible with Deno. According to the official Deno documentation, Deno provides polyfills for several built-in Node.js APIs, including those Layerfig uses for file loading (node:path and node:fs).

The library is not yet published to jsr (the Deno package registry). However, since Deno supports npm packages, you can install Layerfig using the following command:

Terminal window
deno add npm:@layerfig/config

After installation, follow the setup process described in the Getting Started guide.

The main difference when using Deno is its security model, which restricts file system access by default. Therefore, you must use the --allow-read flag when running your application.

Terminal window
deno run --allow-read --allow-net --watch server.ts

With this setup complete, you can load your configuration files and access the config object throughout your application.