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

@jesstelford/devenv-bootstrap

v0.1.1

Published

One-command setup for devenv + direnv on a fresh machine. Installs Lix, direnv, and devenv; configures the shell hook; ships a quiet, log-on-failure use_devenv_quiet helper; scaffolds devenv.nix/.envrc for new projects.

Downloads

231

Readme

@jesstelford/devenv-bootstrap

One command. Fresh machine to working devenv shell.

npx @jesstelford/devenv-bootstrap

What it does

Run inside any directory:

  1. Installs Lix (the Nix fork) if nix is missing.
  2. Installs direnv and devenv via nix profile.
  3. Adds the direnv hook to ~/.zshrc or ~/.bashrc (idempotent).
  4. Writes ~/.config/direnv/direnv.toml with hide_env_diff = true to silence the long direnv: export +VAR1 +VAR2 ... summary on every load.
  5. Installs a use_devenv_quiet helper into ~/.config/direnv/direnvrc (in a marker block — re-runs update it cleanly). The helper:
    • Streams full devenv progress on first build (so the terminal doesn't appear frozen during nix substitutions).
    • Stays quiet on cached loads (one summary line: direnv: devenv ready (logs: …)).
    • Captures all output to a per-project log under $TMPDIR.
    • Dumps the log + a FAILED line on build error.
  6. If the current directory has no devenv.nix / devenv.yaml / .envrc, scaffolds minimal starters. Existing files are left alone (an existing .envrc is backed up to .envrc.bak only if it doesn't already use devenv_quiet).
  7. Adds .devenv/, .devenv.flake.nix, .direnv/ to .gitignore if absent.
  8. Runs direnv allow . for the current directory.
  9. Prints commands to activate the env in the current shell (for agents/CI that can't open a new terminal).

Idempotent throughout. Re-running picks up new versions of the helper and skips anything already done.

Per-project files after bootstrap

A bootstrapped project contains:

devenv.nix       # your packages and shell hooks (the only project-specific file)
devenv.yaml      # input pinning (boilerplate)
devenv.lock      # generated by direnv allow / devenv shell — commit this
.envrc           # 4-line stub:
                 #   if ! command -v devenv &>/dev/null; then
                 #     echo "[setup] devenv not on PATH. Run: npx @jesstelford/devenv-bootstrap"
                 #     exit 1
                 #   fi
                 #   use devenv_quiet

No per-project setup script. The .envrc is the same one line in every project — the heavy lifting lives in the user-level direnvrc.

Activation

After running the bootstrap, either:

  • Open a new terminal — the direnv hook is now in your shell rc, so cd into the project auto-activates it.
  • Stay in the current shell (agent / CI workflows):
    . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
    eval "$(direnv export zsh)"   # or bash
    The bootstrap prints these exact commands at the end of its run.

Output on each direnv load

direnv: loading ~/myproject/.envrc
direnv: devenv ready (logs: /var/folders/…/T/direnv-myproject.log)

Two lines. The full devenv chatter is in the log file if you want to inspect it; on build failure the log is dumped to your terminal automatically.

Re-running the bootstrap

Safe and useful:

  • After upgrading the bootstrap (npx @jesstelford/devenv-bootstrap@latest), the marker block in ~/.config/direnv/direnvrc is rewritten with the latest helper.
  • In a fresh project directory it scaffolds the missing files.
  • In an already-bootstrapped project it's effectively a no-op except for direnv allow.

Requirements

  • macOS (Darwin) or Linux
  • A POSIX shell (zsh recommended; bash 3.2 on macOS auto-re-execs into zsh)
  • Node 18+ if invoking via npx (not required if you fetch and run the script directly)

Sudo is needed only for the Lix install step on first run, and only if nix isn't already installed.

Direct (no-Node) install

curl -sSf https://raw.githubusercontent.com/jesstelford/devenv-bootstrap/main/lib/bootstrap.sh | bash

Why a separate tool?

A bootstrap script that lives inside a project repo can't do the machine-level work (writing your shell rc, your global direnvrc, your direnv.toml) without copy-paste between repos. Putting it in npx-shaped distribution means:

  • Every devenv project's .envrc becomes the same four lines, not 50.
  • Bug fixes and improvements to the quiet wrapper roll out to every project on the next bootstrap run, instead of being copy-pasted.
  • New projects scaffold from npx instead of from a cookiecutter or template repo.

License

MIT