From 5d74f62c339ffd357bb97cf25272212598b1ec9b Mon Sep 17 00:00:00 2001 From: tactonbishop Date: Tue, 2 Aug 2022 19:00:04 +0100 Subject: [PATCH] Last Sync: 2022-08-02 19:00:04 --- .../NodeJS/{REST => API}/Create_RESTful_API_with_Express.md | 0 Programming_Languages/NodeJS/{REST => API}/Full_example.md | 0 Programming_Languages/NodeJS/{REST => API}/Validation.md | 0 Programming_Languages/NodeJS/Modules/Modules.md | 5 +++-- .../NodeJS/{ => Modules}/Package_management.md | 0 5 files changed, 3 insertions(+), 2 deletions(-) rename Programming_Languages/NodeJS/{REST => API}/Create_RESTful_API_with_Express.md (100%) rename Programming_Languages/NodeJS/{REST => API}/Full_example.md (100%) rename Programming_Languages/NodeJS/{REST => API}/Validation.md (100%) rename Programming_Languages/NodeJS/{ => Modules}/Package_management.md (100%) diff --git a/Programming_Languages/NodeJS/REST/Create_RESTful_API_with_Express.md b/Programming_Languages/NodeJS/API/Create_RESTful_API_with_Express.md similarity index 100% rename from Programming_Languages/NodeJS/REST/Create_RESTful_API_with_Express.md rename to Programming_Languages/NodeJS/API/Create_RESTful_API_with_Express.md diff --git a/Programming_Languages/NodeJS/REST/Full_example.md b/Programming_Languages/NodeJS/API/Full_example.md similarity index 100% rename from Programming_Languages/NodeJS/REST/Full_example.md rename to Programming_Languages/NodeJS/API/Full_example.md diff --git a/Programming_Languages/NodeJS/REST/Validation.md b/Programming_Languages/NodeJS/API/Validation.md similarity index 100% rename from Programming_Languages/NodeJS/REST/Validation.md rename to Programming_Languages/NodeJS/API/Validation.md diff --git a/Programming_Languages/NodeJS/Modules/Modules.md b/Programming_Languages/NodeJS/Modules/Modules.md index 8eca718..c345c41 100644 --- a/Programming_Languages/NodeJS/Modules/Modules.md +++ b/Programming_Languages/NodeJS/Modules/Modules.md @@ -146,7 +146,7 @@ module.exports = { } ``` -**Both of these structures would be referred to in the same way when importing and using them** +**Both of these structures would be referred to in the same way when importing and using them.** Or you could export an actual class as the default. This is practically the same as the two above other than that you would have to use `new` to initiate an instance of the class. @@ -155,4 +155,5 @@ export default class { foo() {} bar() {} } -``` \ No newline at end of file +``` +Every method and property within the export will be public by default, whether it is an object, class or function. If you wanted to keep certain methods/properties private, the best approach is to define them as variables and functions within the module file but outside of the `export` block. \ No newline at end of file diff --git a/Programming_Languages/NodeJS/Package_management.md b/Programming_Languages/NodeJS/Modules/Package_management.md similarity index 100% rename from Programming_Languages/NodeJS/Package_management.md rename to Programming_Languages/NodeJS/Modules/Package_management.md