Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

env-var

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-var - npm Package Compare versions

Comparing version 3.4.1 to 3.4.2

5

CHANGELOG.md

@@ -1,2 +0,5 @@

## 3.4.0 (06/11/18)
## 3.4.2 (06/11/18)
* Fix README badge copy/paste error
## 3.4.1 (06/11/18)
* Fix TypeScript definition for "asBoolStrict" function name

@@ -3,0 +6,0 @@

8

package.json
{
"name": "env-var",
"version": "3.4.1",
"version": "3.4.2",
"description": "Verification, sanatization, and type coercion for environment variables in Node.js",

@@ -12,3 +12,4 @@ "main": "env-var.js",

"unit": "mocha test/",
"lint": "standard example/*.js *.js lib/*.js lib/**/*.js test/*.js --fix",
"precommit": "npm run lint && npm run unit",
"lint": "standard example/*.js *.js \"lib/**/*.js\" test/*.js --fix",
"test": "npm run unit && npm run coverage && npm run check-coverage && npm run lint && npm run ts-verify",

@@ -50,6 +51,7 @@ "ts-verify": "tsc test/index.ts --noEmit --target es5"

"devDependencies": {
"@types/node": "~10.12.0",
"@types/node": "~10.12.10",
"bluebird": "~3.5.1",
"chai": "~4.2.0",
"coveralls": "~3.0.0",
"husky": "~1.2.0",
"mocha": "~5.2.0",

@@ -56,0 +58,0 @@ "mocha-lcov-reporter": "~1.3.0",

@@ -5,4 +5,5 @@ # env-var

[![Coverage Status](https://coveralls.io/repos/github/evanshortiss/env-var/badge.svg?branch=master)](https://coveralls.io/github/evanshortiss/env-var?branch=master)
[![npm version](https://badge.fury.io/js/env-var.svg)](https://badge.fury.io/js/env-var)
[![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.svg?v=101)](https://github.com/ellerbrock/typescript-badges/)
[![npm version](https://badge.fury.io/js/env-var.svg)](https://www.npmjs.com/package/env-var)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](http://www.typescriptlang.org/)
[![npm downloads](https://img.shields.io/npm/dm/env-var.svg?style=flat)](https://www.npmjs.com/package/env-var)
[![Greenkeeper badge](https://badges.greenkeeper.io/evanshortiss/env-var.svg)](https://greenkeeper.io/)

@@ -25,7 +26,7 @@

const PASSWORD = env.get('DB_PASSWORD')
// Optional: Throws an error if the DB_PASSWORD variable is not set
// Throws an error if the DB_PASSWORD variable is not set (optional)
.required()
// Optional: Convert DB_PASSWORD from base64 to a regular utf8 string
// Convert DB_PASSWORD from base64 to a regular utf8 string (optional)
.convertFromBase64()
// Required: Call asString (or other methods) to get the value of the variable
// Call asString (or other methods) to get the variable value (required)
.asString();

@@ -39,3 +40,4 @@ ```

// Read a PORT environment variable and verify it's a positive integer
// Read a PORT environment variable and verify it's a positive integer.
// If port is not set then we throw an error
const PORT = env.get('PORT').required().asIntPositive();

@@ -53,3 +55,3 @@ ```

Is nicer than this:
Is cleaner than this:

@@ -56,0 +58,0 @@ ```js

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc