Repository
https://github.com/electron/electron
What Will I Learn?
- You will learn to create an electron application
- You will learn how to read files with electron
Requirements
- Atom Editor:https://atom.io/
- Electron: https://electronjs.org/
- Npm: https://www.npmjs.com/
Difficulty
- Intermediate
Description
- In this video I will show you how to read data from file operations with electron
I will create the data reading codes from the file using the file system codes in nodejs
I have created an example for you to better understand the subject
STEP 1
I have added one file containing the data the name of the file contacts
The data holds the information of the users
Our application will allow us to login the user using this data
STEP 2
I will design a page that request a username and password
I will print success if the Values entered are equal to the Values in the file
İf it is not equal I will write an error
Let’s start
Firstly I will show the codes I wrote
I wrote the user name and password field
and create a button and message label
I will do the codes create a page named a view.js
Define a Jquery and file system
Let’ s keep the name of the contacts file in filename
Catch the moment when button is clicked
Define username and password input
I will desşgn the button and input Bootstrap so I wrote the Bootstrap extension
So we can now capture the Values entered into the inputs
Now we read all the data in the file
Converted to utf8 format
I defined an array based on the space
Let’s write the console at thesame time
We can now return in this array
Then we split the data by comma we can Access all the information of a user
So we named each field
There are two areas as seen, the first domain represent the name and the second field represent value
Operator colon separeting these two fields
Let’s check whether the data in the file is written to the input equally
İf it is equal to flag value
Set i=1;
İf i value one is success else print error
Video Tutorial
Github Project Link
Curriculum
IPC in Electron Tutorial
The Remaining Character Calculation Application in the electron