-
Notifications
You must be signed in to change notification settings - Fork 79
fs undefined #29
Comments
The readme says under Module exports Also, see the relevant source code So, What were you expecting this to do browser-side anyways? |
@zenflow Thank you. I saw the readme; I just thought that setting it to null means that some of the node-libs-browser code would set it to a default value. I am looking at atom editor's fs-plus code and they are using nodejs fs inside their code which is reading some file configuration on the client-side so I thought I can use fs on client-side. If this is not applicable on the browser-side do you think they did anything special to use it? |
Yup.. very special. Read a bit about electron.. formerly known as atom-shell. It's used to make desktop apps. It allows you to use both (a) nodejs API's and (b) browser API's together. There is no browser-side separate from server-side. It's just one side, and it's both brower-side and server-side. Does that make sense? If you're making a web-app (as opposed to a desktop app), you won't be able to use the If you're looking to simulate the usage of Anyhow, we should probably close this issue since we've diverged from the topic of issues with this repo. Gitter is pretty awesome for these types of conversations, and it looks like there is a webpack community there. Good luck! |
@zenflow I appreciate the comprehensive explanation as I am new to web programming and the info you gave me really help. I will be translating this to a desktop app but I am first building the core structure of my app in pure javascript so that I can use it in different web frameworks such as React and Angular depending on which would fit my goals for the app. I will be using fs the same way as atom does which is to read config files. I first thought that atom did everything mainly in javascript and just used electron to translate it in a desktop app but I now realized that it is tightly coupled with electron and chromium. I will just mock the files now. Thanks also for introducing me to Gifter. |
@jannavarro My pleasure :) Go team open-source! |
In my js file I have:
var fs = require('fs');
when I tried fs.readFileSync(..somefile);
Error is: fs.readFileSync is not a function
Is there any setup needed?
The text was updated successfully, but these errors were encountered: