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

directus-extension-environment-lock

v0.1.1

Published

A bundle extension that locks schema changes in a specific environment in Directus

Readme

directus-extension-environment-lock NPM Version

This bundle extension adds the ability to lock schema changes in a specific environment, and includes a panel that displays the status of the environment lock.

[!CAUTION] This extension is still work in progress, and have not been extensively tested. Use with caution!

Features

  • Lock schema changes in a specific environment
  • Display the status of the environment lock in a panel
  • Exclude specific filters from the environment lock
  • Whitelist specific roles from the environment lock

Installation

Install the extension from the Directus Marketplace. See the Official Guide for more information.

Or if you prefer to install manually:

npm install directus-extension-environment-lock

Usage

Environment Variables

| Variable | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | DIRECTUS_ENV_LOCKED | A comma-separated list of environments that are locked. | | DIRECTUS_ENV_WHITELISTED_ROLES | A comma-separated list of role UUIDS that are allowed to make schema changes and bypass the environment lock. | | DIRECTUS_ENV_WHITELISTED_TOKENS | A comma-separated list of tokens that are allowed to make schema changes and bypass the environment lock. | | DIRECTUS_ENV_INCLUDE_FILTERS | A comma-separated list of filters that are included in the environment lock. Will merge with the defaults. | | DIRECTUS_ENV_EXCLUDE_FILTERS | A comma-separated list of filters that are excluded from the environment lock. |

DIRECTUS_ENV_LOCKED

A comma-separated list of environments that are locked.

Default: null

Example:

DIRECTUS_ENV_LOCKED="development,staging"

DIRECTUS_ENV_WHITELISTED_ROLES

A comma-separated list of role UUIDS that are allowed to make schema changes and bypass the environment lock.

Default: null

Example:

DIRECTUS_ENV_WHITELISTED_ROLES="123e4567-e89b-12d3-a456-426614174000,123e4567-e89b-12d3-a456-426614174001"

DIRECTUS_ENV_WHITELISTED_TOKENS

A comma-separated list of tokens that are allowed to make schema changes and bypass the environment lock.

Default: null

Example:

DIRECTUS_ENV_WHITELISTED_TOKENS="123e4567-e89b-12d3-a456-426614174000,123e4567-e89b-12d3-a456-426614174001"

DIRECTUS_ENV_INCLUDE_FILTERS

A comma-separated list of filters that are included in the environment lock. Will merge with the defaults.

Default: See available filters

Example:

DIRECTUS_ENV_INCLUDE_FILTERS="fields.create,fields.update,fields.delete"

DIRECTUS_ENV_EXCLUDE_FILTERS

A comma-separated list of filters that are excluded from the environment lock.

Default: null

Example:

DIRECTUS_ENV_EXCLUDE_FILTERS="fields.create,fields.update,fields.delete"

Available filters

The following filters are active by default. You can exclude specific filters from the environment lock by setting the DIRECTUS_ENV_EXCLUDE_FILTERS environment variable, or include others by setting the DIRECTUS_ENV_INCLUDE_FILTERS environment variable.

List of all available filters

| Filter | Description | | ------------------ | --------------------------- | | fields.create | Creation of any fields | | fields.update | Updates to any fields | | fields.delete | Deletion of any fields | | collections.create | Creation of any collections | | collections.update | Updates to any collections | | collections.delete | Deletion of any collections | | relations.create | Creation of any relations | | relations.update | Updates to any relations | | settings.update | Updates to any settings | | roles.create | Creation of any roles | | roles.update | Updates to any roles | | roles.delete | Deletion of any roles | | policies.create | Creation of any policies | | policies.update | Updates to any policies | | policies.delete | Deletion of any policies |


Panel

The extension includes a panel that displays the status of the environment lock.


Hooks

The extension includes hooks that are used to lock schema changes in a specific environment.


Development

Setup

  1. Load Extension volume in your project and clone the repository to it

  2. Install dependencies:

cd extensions/directus-extension-environment-lock

npm install
  1. Build the extension with auto rebuild on changes:
npm run dev

Make sure you've set EXTENSIONS_AUTO_RELOAD in your .env file.

You might need to restart your Directus instance for the extension to be loaded.

Building

npm run build