From 2c4a53bc453c6b0beac483d3e41d96bd2fda59f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Bostr=C3=B6m?= Date: Thu, 20 Oct 2016 17:13:39 +0300 Subject: [PATCH 1/2] Replace winston with console --- package.json | 3 +-- src/index.js | 3 +-- test/test.spec.js | 10 +++------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index aa29071..3854f61 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ }, "dependencies": { "dotenv": "^2.0.0", - "lodash": "^4.3.0", - "winston": "^2.1.1" + "lodash": "^4.3.0" } } diff --git a/src/index.js b/src/index.js index 6c1881a..041092d 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,6 @@ import _ from 'lodash'; import dotenv from 'dotenv'; import fs from 'fs'; -import winston from 'winston'; function loadEnvironmentFile(path, encoding, silent) { try { @@ -12,7 +11,7 @@ function loadEnvironmentFile(path, encoding, silent) { return dotenv.parse(data); } catch (err) { if (!silent) { - winston.error(err.message); + console.error(err.message); } return {}; } diff --git a/test/test.spec.js b/test/test.spec.js index a00b382..64e58a5 100644 --- a/test/test.spec.js +++ b/test/test.spec.js @@ -11,7 +11,7 @@ var chai = require('chai'), chai.use(sinonChai); describe('dotenv-extended tests', function () { - var dotenvex, winstonStub; + var dotenvex; before(function () { mockery.enable({ @@ -19,11 +19,7 @@ describe('dotenv-extended tests', function () { warnOnUnregistered: false, useCleanCache: true }); - - winstonStub = { - error: sinon.stub() - }; - mockery.registerMock('winston', winstonStub); + sinon.stub(console, 'error'); dotenvex = require('../'); }); @@ -108,6 +104,6 @@ describe('dotenv-extended tests', function () { it('Should log an error when silent is set to false and .env.defaults is missing', function () { dotenvex.load({ silent: false }); - expect(winstonStub.error).to.have.been.calledOnce; + expect(console.error).to.have.been.calledOnce; }); }); From d0c1d7761ab91210db13aa0ddcd56ad1b1cbf987 Mon Sep 17 00:00:00 2001 From: Keith Morris Date: Sun, 23 Oct 2016 09:28:23 -0400 Subject: [PATCH 2/2] Update changelog and bump version --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7020760..f2bcf6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.0.4 - 2016.10.23 +- Replace `winston` library with generic `console` (Thanks @bostrom) + ## 1.0.3 - 2016.08.06 - Fix comma-space typo in thrown error (Thanks @niftylettuce) diff --git a/package.json b/package.json index 3854f61..2c3484f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dotenv-extended", - "version": "1.0.3", + "version": "1.0.4", "description": "A module for loading .env files and optionally loading defaults and a schema for validating all values are present.", "repository": "git@github.com:keithmorris/node-dotenv-extended.git", "main": "lib/index.js",