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

fibe-env

v1.1.2

Published

.env settings and distribution

Downloads

6

Readme

Managing environment variables and distribution

===

ES6 styled .env settings and distribution throughout your application.

The why is power:

The first in a series of fibe modules. Starting a new project, a different take on (un)known problems. The modules will be published as we go with this project in the hope it gives you good vibes.

--with love, quirks and glitches, Idiosyncratics

Get fibe-env


npm install fibe-env

See example

Example included in the repository.

Usage

Add an .env file to your project root and define key and value pairs.

ENV_KEY1   value

env_node_key1:this_is_fine
ENV_NODE_KEY2:this_is_fine
ENV_NODE_KEY2:this_is_removed
ENV_NODE_KEY3: this_is_fine
ENV_NODE_KEY4:  this_is_fine
ENV_NODE_KEY5$  this_is_fine:butremoved_fromhere
ENV_NODE_KEY6$this_is_not_fine
ENV_NODE_KEY7   ENV_NODE_KEY7 doube_key_removed

Import the module and add the config.

import env from 'fibe-env';
const newEnv = new env();

That's it!, your .env content is now available.

Get commands to view your env.

// get the configuration.
getMeta()

// get the env variables.
getEnv()

Secured

By default the .env variables are checked in, meaning they can not be altered or new pairs added. The options and variables can only be viewed with the get functions.

Options and settings

To set fibe-env options:

Put them in the .env:

FIBE_ENV_STRICT: true
FIBE_ENV_CHECKOUT: false
FIBE_ENV_INTRINSICS: false
FIBE_ENV_PROCESS_ENV: false
FIBE_ENV_GLOBAL: false

Pass an options object:

const options = {
    file: '.env',
    path: __dirname,
    strict: true,
    checkout: false,
    processEnv: false,
    global: false,
    intrinsics: false
}
const newEnv = new env(options);

Alternatively you can call options separately:

// set a new key-value pair, double keys are not added.
setEnv(key, value)

// delete a new key-value pair.
delEnv(key)

// check-in of your env scope (cannot be checked out).
setCheckIn()

// set use-strict on all modules.
setStrict()

// check-in of your process.env scope (cannot be undone).
setProcessEnv()

// "--frozen-intrinsics": JavaScript objects and functions are recursively frozen, except for globalThis.
// If node is not started with this as an argument it can still be applied to worker & child-processes.
setIntrinsics()

// check-in global variables scope.
setGlobal()

// check-in strict, global and env with one command. 
setLockdown() 

It's all thanks to you

Thanks to all the patient people on forums and contributors helping curious and creative people solve their problems, one at a time. Thank you.