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

env-deploy

v0.2.1

Published

auto load .env file if it exist, allow json format, plain env string, and with easier accessible method without using process.env

Readme

Introduce

Build Status

NPM

You may be coding in local, use yourself mysql , mongodb, etc. But in deploy server, the mysql,mongodb's username and password is different. Usually, username and password pass into program through environment. So, this package can auto switch env, if you have a .env file in root of project

Usage

  1. npm install env-deploy
  2. add a .env file to your project in root path, write env data use json format in it
  3. add .env to .gitignore file to ignore it
  4. coding, commit, push
  5. to deploy server. pull, checkout
  6. without .env file to run project

Yeah, you don't to change any code

Example

my project

  • project
    • .env
    • index.js
    • .gitignore

.env, now only support json format. allow recursive, join with _

{
    "MONGODB": "localhost",
    "MONGO": {
        "USER": "root",
        "Port": 27017
    }
}

or

# in this format, two kind of comment is supported
# one is prefix line with `#`
// the other is prefix line with `//`
MONGODB = localhost
MONGO_USER = root
MONGO_Port = 27017

in json format, all value would be save as String even if it's a Number. Such as typeof MONGO_PORT return String.

default, all env name will be save as upper case. You can set autoTransformCase as false to turn off this.

index.js - find .env file under __dirname which pass to it. Or it's' default is process.cwd()

require('env-deploy')(__dirname);
console.log(process.env.MONGODB);
console.log(process.env.MONGO_USER);
console.log(process.env.MONGO_PORT);

.gitignore

.env

run with with .env file

localhost
root
27017

in deploy server without .env file, but have environment like MONGODB=111.111.111.111 MONGO_USER=data

111.111.111.111
data
27017

API

env_deploy

  • env_deploy([file = process.pwd(),] [config])
    • file {String} filename, relative or absolute path, even directory path contains .env file
    • config {Object}
      • autoTransformCase {Boolean} true to auto transform case to upper, false to disable.

Thanks

thanks for your usage, welcome you to pull request to me.

suggest used in mac os or linux

TODO

[x] support key=value format