Reputation: 2631
Like to know is there any javascript engine for doing file operations such as create, reads, write , and parse file in file system.
Upvotes: 0
Views: 153
Reputation: 1234
Javascript has no such thing as file operations natively.
The word engine is a bit vague here. There are a couple of different javascript interpreters. V8, Spidermonkey, JavaScriptCore, etc. These implmement only Javascript.
What you need is an extension - a library (typically written in C) which exposes this functionality through the interpreter into the script scope as javascript objects and functions.
node.js is a good example of a suite of javascript extensions with support for this. It is based on the V8 javascript interpreter.
Upvotes: 0
Reputation: 140220
You can use the File System API, but this is for a virtual sandboxed filesystem you need to create yourself (by making your own files or having user select them from their filesystem). Obviously you can't just access the real file system directly in a browser.
For node.js, use the fs
module.
Upvotes: 3