Why not use JSON.parse(fs.readFileSync(file))?

Trying to make a module "standalone" is generally a waste of time if you 
have to even implement file system access and basic json parsing yourself.. 

On Monday, July 29, 2013 5:19:52 AM UTC+2, ryandesign wrote:
>
> My library needs to load text files (some of which might be JSON) on 
> demand. In the browser I could use XMLHttpRequest; in node I could use the 
> built-in fs module. Does anybody know an npm module that wraps all this up 
> for me in a single function I can use and have it just work in both 
> environments, much like I use canvas-browserify to give me a Canvas object 
> that just works in both the browser and in node? 
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to