Comments (7)
Thanks for the bug report, I will look at it now.
from node-env-file.
I could not reproduce the error. I think it could be related to Windows environments only, could you help me figure out what row the error is raised on? I don't got any Windows environment.
from node-env-file.
I have cloned the repository on my computer;
This is what I had:
Then I ran the examples/basic.js test
It looks like I the error is on line 104 on lib/index.js
while it's working fine on v0.1.5
After investigation on the file, I find out that the issue concerns the carriage returns character \r
:
If I removed the last char like this: (see around line 104)
module.exports.lines.variables.push(line)
console.log('Line *' +line+'*');
line = line.substring(0, line.length - 1);
console.log('Line without \r *'+line+'*')
var key_value = line.match(/^([^=]+)\s*=\s*(.*)$/)
console.log('key_value *'+key_value+'*');
var env_key = key_value[1]
it works nicely. It would be better to work on the regex to avoid the use of the substring function but I didn't find a way round it
As a complement, here is the output I got from adding the console into the code
from node-env-file.
@maldestor95 Thanks, this is very helpful. Managed to trigger a failed test for this:
Need to figure out a clean way to test this now without bloat.
from node-env-file.
Generated some failing tests and fixed the issue, give it a try. Thanks for the visual details!
from node-env-file.
Just to let you know I have successfully tested 0.1.7 on windows 8.1.
- inside the clone copy of the repo
- used as a dependency of my app.
Thanks for the quick fix
from node-env-file.
Great!
from node-env-file.
Related Issues (9)
- NPM version out of date HOT 4
- # chars break parsing HOT 2
- Examples broken, Client use broken... HOT 2
- Feature request: option to allow non-existing .env file HOT 3
- Can you publish an npm release with the dependancies moved to dev? HOT 1
- fs.existsSync(path) is deprecated HOT 2
- Duplicating data in the output HOT 1
- can't set false ! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-env-file.