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 🙏

© 2024 – Pkg Stats / Ryan Hefner

biome

v0.3.3

Published

A simple way to manage environment variables on a per-project basis

Downloads

5,819

Readme

Biome: a small script to manage a user's environment variables

CircleCI npm version Licence

Manage environment variables in a sane way. Never push up secrets again!

  • Enforces a clear separation of secrets and code.
  • All secrets are in one configurable place. (by default, ~/.biome)
  • Associate any number of variables with any number of projects.
  • Easily create complex variable structures that inherit from one-another.

Installation

npm install -g biome

Usage

$ biome --help
  Usage: biome [options] [command]

  Commands:

    init [project]            Create a new project with the specified name, and save an alias to this folder.
    add [project]             Add a variable to a project. Specify like NAME=value.
    use [project]             Open a shell with a project's associated variables included.
    edit [project]            Open $EDITOR with the project's associated environment variables.
    vars [options] [project]  Echo all variables.

  Options:
    -h, --help     output usage information
    -V, --version  output the version number

  Examples:

  $ biome init project
  $ biome add project FOO=bar BAZ="I'm a teapot"
  $ biome use project

Workflow

To set up an environment, first run biome init project to set up a new environment called project. Then, to add new variables to an environment, run biome add project KEY=value. To perform more complicated configurations, edit the environment directly with biome edit project.

Once you'd like to use the environment, run biome use project. A new instance of $SHELL will be spawned containing all the configured variables, plus a few Biome-specific ones. To view your current environment, type biome.

How it works:

For each project, biome creates 2 files: a local Biomefile and a global project.json.

// Biomefile
{
  "name": "project"
}
// project.json
{
  "VARIABLE": "value"
}

The local Biomefile can be committed to source control because it just contains a reference to the global project. The project.json is stored in ~/.biome/project.json, where project is replaced with the identifier in the Biomefile. This file is where the environment variables themselves are actually stored. Since each user can have a separate project.json for each system, everyone can customize their config to suit their needs.

Configuration

  • BIOME_LOCAL_NAME: The name of the file in the project that references an environment. Defaults to Biomefile.
  • BIOME_FOLDER_NAME: The name of the folder that biome stores all secrets within. Defaults to ~/.biome.

Tips and Tricks

  • Want to include other environments into a project? Within the project's environment, add the special key $include mapping to an array of envornments. For example, "$include": ["another", "environment", "here"].
  • Easily give new users a simple way to enter values. Within the Biomefile, define a property called template. Each key of template should be the variable name, while each value should be its default value. For example:
{
  "name": "my-project",
  "template": {
    "KEY": "value"
  }
}

Then, when the user runs biome init, they'll be prompted for the values specified. Above, they'd be prompted for KEY, and given a default choice of "value".

  • Don't want to hardcode templates into a project? As an argument to biome init, specify a template url after the project name, like biome init project http://example.com/template.json.

Created by Ryan Gaus