New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

env-files-parser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-files-parser

Parse env files to typescript

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

env-parser

.env parser written in deno

Usage

$ cat .env
# this is a comment
str="value"
nospace=nospace

# a few blank lines

is_true=true
is_false=false
num=123
zero=0
str_start_zero=0123
import { parse } from "https://raw.githubusercontent.com/ppdx999/deno-env-parser/main/mod.ts";
/*
if you use node, run `npm i env-files-parser` and import like below

import { parse } from "env-files-parser";

*/

// somehow read string data from .env file
const env: string = readFile('env')

const result = [
  "# this is a comment",
  ["str", "value"],
  ["nospace", "nospace"],
  "",
  "# a few blank lines",
  "",
  ["is_true", true],
  ["is_false", false],
  ["num", 123],
  ["zero", 0],
  ["str_start_zero", "0123"],
];

result == parser(env) // --> true

FAQs

Package last updated on 28 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts