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

@bark/dotenv

v0.2.0

Published

Read and populate environment variables from a .env file

Downloads

7

Readme

@bark/dotenv

Build Status

A dependency free env file reader and writer for Node.js

About

There already exists a pretty good library for reading .env files. @bark/dotenv, however, aims to provide an extra level of validation and consistency with the implicit .env file standard. A .env file should be sourceable in a shell script, which means that certain extra restrictions (as well as some additional lax-ness) need to be adhered to.

Values with spaces in them need to be quoted, otherwise this is a syntax error. In addition, escaped quotation marks inside of quoted sections should be printed literally in the interpreted value. Shell scripts also allow quoted sections within strings (e.g. my" value" is valid, equal to the string "my value")

Philosophy

Libraries like @bark/dotenv are all about making life easier for developing and deploying - if something goes wrong, you don't want to spend an age tracing through config files trying to figure out where the error is. If something goes wrong loading your configs, @bark/dotenv tells you excactly why it failed, and where the error happened so that you can keep the development loop tight and not waste time

selection_411

Usage

To read a .env formatted string

const { reader } = require('@bark/dotenv')
const values = reader(`
APP_KEY=123
# This one gets changed a lot
FOO_BAR=https://localhost:8001
`)

console.log(values) // { "APP_KEY": "123", "FOO_BAR": "https://localhost:8001" }

Roadmap to v1.0.0

@bark/dotenv aims to offer a complete suite of tools for dealing with .env files - not just reading them. Each feature is one step closer to completion, but wont be considered complete until it also has a comprehensive test suite to accompany it

  • [x] Read .env file string into dumb object
  • [ ] Read .env file into editable representation
  • [ ] Save .env file from editable representation
  • [ ] Disk I/O
  • [ ] Format Verification