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 🙏

© 2025 – Pkg Stats / Ryan Hefner

unienv

v1.0.2

Published

Environment configuration manager for every type of project

Downloads

16

Readme

UNIENV

Universal environment variables and configuration manager for multi-language projects.

In projects with multiple programming languages and complex build processes (like react-native) it may be hard to have a .env file for your environment configuration.
This lib is a git based solution for any type of project (with non-binary source files), that allows you to directly inject your environment variables values in the source code (and remove them before you commit or push your changes to remote) in an automated fashion.

Installation

> npm install unienv --save-dev

| Note: if your project has CD, it may be useful to have the lib as a production dependency.

How it works

Values application (apply option):

  • Create a new branch (called unienv) (to do not mess with your job);
  • Commit all your changes (so your work doesn't get lost);
  • Read the specified .env file (.env if none specified) and parses the keys and values; *
  • Read and search for the keys (using the --prefix if specified) in every non-binary file not ignored by the .gitignore file or the --alsoIgnore option;
  • Replace the keys with the values and commit everything (so the application can be reverted at a later point).

* Every file's path operation is relative to the current working directory.

Values removal (revert option):

  • Revert the last commit in the active branch (hope you haven't done any git operation before, as you were told not to do); *
  • Reset the 2 last commits, retrieving your work;
  • Get back to your previous branch and remove the unienv branch.

* The unienv revert command may fail at this point, for example, if you change a file which uses environment variables before running unienv revert. In this case, just run git stash push before the revert and git stash pop after.

Docopt docs, for command line enthusiasts

Usage:  
    unienv apply [--env=<file_path>] [--prefix=<any_text>] [--alsoIgnore=<csv_gitignores>]  
    unienv revert  
    unienv --help  

Options:  
    apply        Reads keys and values from .env or specified file and  
                 replaces keys [with prefix] in source code;  
    revert       Revert all changes made by the apply command;  
    --env        File to read environment variables. May have single or double quotes.  
                 The default is relative to the project root [default: ~/.env];  
    --prefix     Text to precede variable name in source code (for example, with  
                 --prefix=@, unienv will see API_URL in .env and search for  
                 @API_URL in source code). May have single or double quotes;  
    --alsoIgnore List of comma separated gitignore like patterns not included in  
                 .gitignore file;  
    --help       Shows README.md.

React-Native usage example:

{
  "name": "test",
  "version": "1.0.0",
  "scripts": {

    "android-dev": "npm run env-dev && react-native run-android",
    "android-staging": "npm run env-staging && react-native run-android",
    "android-prod": "npm run env-prod && react-native run-android",

    "build-android-dev": "npm run env-dev && cd android && ./gradlew assembleDebug && cd .. && npm run env-revert",
    "build-android-staging": "npm run env-staging && cd android && ./gradlew assembleRelease && cd .. && npm run env-revert",
    "build-android-prod": "npm run env-prod && cd android && ./gradlew bundleRelease && cd .. && npm run env-revert",

    "env-dev": "unienv apply --prefix=# --alsoIgnore=ios/Pods --env=.env.dev",
    "env-staging": "unienv apply --prefix=# --alsoIgnore=ios/Pods --env=.env.staging",
    "env-prod": "unienv apply --prefix=# --alsoIgnore=ios/Pods --env=.env.prod",
    "env-revert": "unienv revert"
...