Video 10 of Node JS Tutorial, thenewboston
Video Name: Shared State of Modules
- shared objects/modules
- whenever you use modules, the default behavior is to share the module among every other file that imports it
Video 11 of Node JS Tutorial, thenewboston
- shared objects/modules
- whenever you use modules, the default behavior is to share the module among every other file that imports it
Video 11 of Node JS Tutorial, thenewboston
Video Name: Object Factories
- you need to export a function to create a new object
- object factory = object that creates another object
- can have their own custom copy
Video 12 of Node JS Tutorial, thenewboston
- you need to export a function to create a new object
- object factory = object that creates another object
- can have their own custom copy
Video 12 of Node JS Tutorial, thenewboston
Video Name: Core Modules
- core modules are the modules already built into node.js
- there are a lot of them
- fs = file system module
- you don't use the /. in core modules, only custom modules, use only the name (node knows its a core module)
- allows you to read and write files, and delete them
- file system module has 3 parameters
- path module, works with paths, normalizes slashes,
- "setInterval" - can have a bit of code to run, runs repeatedly, similar to the process of "setTimeout" but repeats unlike "setTimeout"
- "dirname" - give directory name (full path)
- "filename" -give file name of whatever file is currently calling the code
- core modules are the modules already built into node.js
- there are a lot of them
- fs = file system module
- you don't use the /. in core modules, only custom modules, use only the name (node knows its a core module)
- allows you to read and write files, and delete them
- file system module has 3 parameters
- path module, works with paths, normalizes slashes,
- "setInterval" - can have a bit of code to run, runs repeatedly, similar to the process of "setTimeout" but repeats unlike "setTimeout"
- "dirname" - give directory name (full path)
- "filename" -give file name of whatever file is currently calling the code
No comments:
Post a Comment