react-native-dotenv
Advanced tools
Comparing version 2.2.1 to 2.2.2
10
index.js
const {readFileSync} = require('fs') | ||
const dotenv = require('dotenv') | ||
function parseDotenvFile(path) { | ||
function parseDotenvFile(path, verbose = false) { | ||
let content | ||
@@ -9,4 +9,8 @@ | ||
content = readFileSync(path) | ||
} catch { | ||
} catch (error) { | ||
// The env file does not exist. | ||
if (verbose) { | ||
console.error('react-native-dotenv', error) | ||
} | ||
return {} | ||
@@ -34,3 +38,3 @@ } | ||
if (this.opts.safe) { | ||
const parsed = parseDotenvFile(this.opts.path) | ||
const parsed = parseDotenvFile(this.opts.path, this.opts.verbose) | ||
const modeParsed = parseDotenvFile(this.opts.path + '.' + babelMode) | ||
@@ -37,0 +41,0 @@ this.env = Object.assign(parsed, modeParsed) |
{ | ||
"name": "react-native-dotenv", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Load environment variables using import statements.", | ||
@@ -5,0 +5,0 @@ "repository": "github:goatandsheep/react-native-dotenv", |
@@ -8,3 +8,3 @@ # react-native-dotenv [![CircleCI](https://circleci.com/gh/goatandsheep/react-native-dotenv.svg?style=svg)](https://circleci.com/gh/goatandsheep/react-native-dotenv) | ||
[![codecov](https://badgen.net/codecov/c/github/goatandsheep/react-native-dotenv)](https://codecov.io/gh/goatandsheep/react-native-dotenv) | ||
[![XO code style](https://badgen.net/badge/code%20style/XO/cyan)](https://github.com/xojs/xo) | ||
[![XO code style](https://badgen.net/badge/code%20style/XO/cyan)](https://github.com/xojs/xo) [![Join the chat at https://gitter.im/pass-it-on/react-native-dotenv](https://badges.gitter.im/pass-it-on/react-native-dotenv.svg)](https://gitter.im/pass-it-on/react-native-dotenv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
@@ -17,2 +17,15 @@ ## Installation | ||
## Story | ||
Many have been asking about recent changes in this repo. Take a look at the | ||
[story wiki page](https://github.com/goatandsheep/react-native-dotenv/wiki/Story-of-this-repo). | ||
If you'd like to become an active contributor, please send us a message. | ||
## Migration | ||
For those moving from v0.2.0 to the latest version, you will find it is quite | ||
the jump. We are working on a migration guide. For now, take a look at the | ||
issues tab at #15 and #18 . | ||
## Usage | ||
@@ -19,0 +32,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19732
191
165