A simple file browser
Now, let's take what we've learned about files and Node to do something that truly (and hopefully) no web page can; let's directly browse the entire hard disk of your personal computer! To make this possible, we'll use two powerful recent additions to the JavaScript and Node family: Electron and Vue.js.
Start out at your terminal with commands like these:
$ mkdir hello_files $ cd hello_files $ npm init $ npm install -S electron
The default answers are fine, except for the entry point—instead of index.js
, type main.js
. When you're done, you should have a package.json
file like this:
{ "name": "hello_files", "version": "0.0.1", "description": "A simple file browser using Node, Electron, and Vue.js", "main": "main.js", "dependencies": { "electron": "^1.7.9" } }
Now, let's take a look at these three commands:
$ ./node_modules/.bin/electron --version $ ./node_modules/.bin/electron $ ./node_modules/.bin/electron .
Try the first to ensure that npm got a working copy...