Skip to content

Commit

Permalink
Merge ec8169d into 1945a05
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbeatty committed May 2, 2018
2 parents 1945a05 + ec8169d commit eae2b39
Show file tree
Hide file tree
Showing 14 changed files with 5,092 additions and 2,130 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Dependency directory
# Commenting this out is preferred by some people, see
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
coverage/
.nyc_output/
examples/
test/
.editorconfig
Expand Down
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
language: node_js

sudo: false
node_js:
- 4
- 6
- 8
- 9

jobs:
include:
- stage: coverage
node_js: 8
script: npm run ci:coverage
- 10
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ an Object with the parsed keys and values.

```js
const dotenv = require('dotenv')
const buf = new Buffer('BASIC=basic')
const buf = Buffer.from('BASIC=basic')
const config = dotenv.parse(buf) // will return an object
console.log(typeof config, config) // object { BASIC : 'basic' }
```
Expand Down Expand Up @@ -213,9 +213,9 @@ export const client = new Client(process.env.BEST_API_KEY)

```js
import dotenv from 'dotenv'
dotenv.config()

import errorReporter from './errorReporter'

dotenv.config()
errorReporter.client.report(new Error('faq example'))
```

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version: "{build}"
build: off
environment:
matrix:
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "9"
- nodejs_version: "10"
install:
- ps: Install-Product node $env:nodejs_version
- npm install
Expand Down
4 changes: 1 addition & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

const fs = require('fs')
const path = require('path')

Expand All @@ -14,7 +12,7 @@ function parse (src) {
// convert Buffers before splitting into lines and processing
src.toString().split('\n').forEach(function (line) {
// matching "KEY' and 'VAL' in 'KEY=VAL'
const keyValueArr = line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/)
const keyValueArr = line.match(/^\s*([\w.-]+)\s*=\s*(.*)?\s*$/)
// matched?
if (keyValueArr != null) {
const key = keyValueArr[1]
Expand Down
Loading

0 comments on commit eae2b39

Please sign in to comment.