where our electron application starts which means we also need to change the start scripts to reflect that so we can just type in electron dot and what this will do is it will open uh run the electron commands in our current directory and it'll look for this main scripts which will then run this URL_TOKEN file and kickstart our whole app okay so now that we have that done let's actually quickly create a quick electron application so i'm going to import browser window app and ipc main equals require electron we're going to do URL_TOKEN ready which returns a promise which we're going to do then and then we're going to run a function when we're ready i'm going to call it main i'm going to create that function i'm going to call it function main in here we're going to run um once our application is ready to go if you have uh any questions with electron i do have a full to tier tutorial series that i highly recommend you check out if you don't actually know how electron works okay so i'm going to create a window i'm going to call it window is equal to a new browser window and this takes in a width i'm going to say NUMBER_TOKEN pixels a height of let's say NUMBER_TOKEN. we're going to set show to false by defaults we're going to do auto hide menu bar to true and then we're going to pass in a web preferences and pass into preload scripts so the preload script is where we actually want to the file we want to preload into our window so i want to create that real quick URL_TOKEN so we want to load this file into our browser window when we create it so what we can do is we can use join uh out join essence we're gonna import join from uh path equals require there we go so we're going to bring in join from path and we're going to join our current directory name and then dot slash preload dot js and this will allow us to load this preload js into our scripts and with that out of the way that is all we have for our preferences next what we can do is do window dot load file which takes in a path to our html file what we're going to do is we're going to use join again the reason we're using join is because it's cross platform so it'll mean that this will work on os x linux and windows so we're going to do join dot dot slash to leave this electron folder and go into the public folder where we have our application so we're going to go to dot slash public slash URL_TOKEN and this is where we have our public assets and all of our build files so once we load the file what we can do is we can do window dot on ready to show so this vent fires when our application dom is ready to be visible and we can do window dot show so we'll pass in that function there we go so when our application is ready to show we'll actually show the window and that's why it's set to false by default so we don't have any annoying flickering next i'm going to include one more variable and i'm going to call it is dev and i'm going to set it equal to the inverse of
START_SELFPROMO_TOKEN if you have uh any questions with electron i do have a full to tier tutorial series that i highly recommend you check out if you don't actually know how electron works END_SELFPROMO_TOKEN