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

files.env

v1.2.0

Published

Modern package for managing environment variables Files with extension “.env”, zero-dependency in the package and easily you can access data in process.env and you can modify and read the data for more details you can read below the method of registering

Downloads

11

Readme

About

Modern package for managing environment variables Files with extension ".env", zero-dependency in the package and easily you can access data in process.env and you can modify and read the data for more details you can read below the method of registering and deleting variables

Table of Contents

Features

  • It allows you to read and write .env files easily and quickly!
  • It does not affect the system values in process.env but you can turn it off if you want but by default it is enabled
  • You can use the package with just a command, without the need to import, which makes the situation easier for you! But you can also import node -r files.env/config index.js
  • Supports writing comments in the file by placing # before the comment line
  • Zero-dependency in the package
  • Allows you to write in the form of an object or add a variable and delete a variable

Installing

Install with npm / yarn / pnpm:

npm install files.env
yarn add files.env
pnpm add files.env

Usage

  • The first step is to create an .env file and put your data in it or use the package to put the data

Configuration

CommonJS

require("files.env").config()
process.env //FileEnv class will be returned to you

ES Module support

import { config} from 'files.env';
config()
process.env//FileEnv class will be returned to you

TypeScript Support

import { FileEnv } from 'files.env';
const env = new FileEnv()
env//FileEnv class will be returned to you

⚠️ Note in the event that you were a TypeScript Why shouldn't you use the config function and instead use the class?? You must know that process.env has an interface and this interface we cannot modify, so you cannot make the methods available through process.env so if you do a config only you will be able to read so you must use the FileEnv class so that you can read and write

Preload

  • If you do this, you do not need to write a callback, the package will be called in advance
$ node -r files.env/config index.js

Example

Example of class FileEnv

// Read variable from file
process.env.set("name","Mohamed Abdelkarim")//Add a variable in the env . file

//Read variables in the file
console.log(process.env.name)// return "Mohamed Abdelkarim"
//or console.log(process.env.get("name"))

//Delete variable from file
process.env.delete("name")

//Check if a variable exists in the file
console.log(process.env.has("name")) 

//To write an object to the file
process.env.writeFile({token:"11",prefix:"#"})

//Delete all variables from the file
process.env.clear()

//Delete and destroy the file
process.env.destroy()

//If you have modified the file and it is running, you can make the package re-read the variables in the file through this method 
process.env.reloadVariables()//Only in the event that you have modified the file and not from methods or if you want to re-make the package to re-read the file!

Parse and stringify

import { parse, stringify } from 'files.env';
console.log(parse('name="Mohamed"')) // return {"name":"Mohamed"}

console.log(stringify({name:"Mohamed"})) // return name="Mohamed"

File structure

  • Structure example
# Registration information
Name="Mohamed Abdelkarim"
UUID="3cae8d3c-5219-11ed-bdc3-0242ac120002"

# API 
Token="12"# your token!

Documentation

You can see the Documentation of the st.db package to know all the details

Help

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official Discord Server .