Monday 11 April 2016

Confused about location of require() modules

HiI'm a complete node.js beginner, so please excuse the noob question. I'm trying to go through and understand the code for Kyoku line by line. It's a super simple electron app that displays the current iTunes song title in the OSX menu bar.Where I've had problems is with understanding the require('module'); thing. I get that require() loads code from an external file, but in this case, i don't understand where this file is located. app.js has require statements for the modules 'app', 'menu', 'tray', 'browser-window', 'playback' and 'user-home', but package.json only mentions dependencies for 'playback'and 'user-home'. The other modules are nowhere to be found in the source code (at least for me). Where does node get them from/How can the app use their code? Are they all "core modules"? Or are they accessed through npmjs.com?Any help or links explaining this would be much appreciated. Thank you!

Submitted April 11, 2016 at 09:45PM by cUk6yij5yaC1daC0Ic0f

No comments:

Post a Comment