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

@nitwel/sandbox

v1.0.8

Published

Toolkit for spinning up directus test environments

Readme

Directus Api Sandbox 🛠️

Utility functions for quickly spinning up and down instances of directus for usage such as testing or development.

Usage

The package offers two ways of interacting, either through calling JS functions or through accessing the command line interface.

CLI

Usage: sandbox [options] <database>

Arguments:
  database                            What database to start the api with (choices: "maria", "cockroachdb", "mssql", "mysql", "oracle", "postgres", "sqlite")

Options:
  -b, --build                         Rebuild directus from source
  -d, --dev                           Start directus in developer mode. Not compatible with build
  -w, --watch                         Restart the api when changes are made
  --inspect                           Start the api with debugger (default: true)
  -p, --port <port>                   Port to start the api on
  -x, --export                        Export the schema to a file every 2 seconds
  -s, --schema [schema]               Load an additional schema snapshot on startup
  --docker.basePort <dockerBasePort>  Minimum port number to use for docker containers
  --docker.keep                       Keep containers running when stopping the sandbox
  --docker.name                       Overwrite the name of the docker project
  -e, --extras <extras>               Enable redis,maildev,saml or other extras
  -i, --instances <instances>         Horizontally scale directus to a given number of instances (default: "1")
  --killPorts                         Forcefully kills all processes that occupy ports that the api would use
  -h, --help                          display help for command

API

The api is accessed through the following two functions:

Example

import { sandbox } from '@directus/sandbox';

const sb = await sandbox('postgres', { dev: true });

// Interact via Rest, GQL or WebSockets
const result = await fetch(sb.env.PUBLIC_URL + '/items/articles');

console.log(await result.json());

await sb.close();

Inner workings

Depending on what is set in the configuration, some of these steps might be skipped:

  1. Building of the api: If enabled, the api is freshly build each time the sandbox is started. Use the watch option to quickly iterate on changes.
  2. Starting of the docker containers: All required docker containers like databases or extras like redis are spun up and awaited until healthy. If the docker containers are still running, they will be reused instead of starting up new ones.
  3. Bootstrapping of the database: If not already bootstrapped, the sandbox will make sure that all necessary database tables are created.
  4. Loading of a schema snapshot: In case the schema option is set, the database will also the snapshot applied before starting directus.
  5. Starting of the api: Finally, the api(s) are spun up with the right environment variables configured.