From a724ac5d8f141314c1cfbbdb6d412c16f6742be5 Mon Sep 17 00:00:00 2001 From: tactonbishop Date: Sat, 16 Jul 2022 10:30:04 +0100 Subject: [PATCH] Last Sync: 2022-07-16 10:30:04 --- .../NodeJS/Architecture/Event_loop.md | 6 +++++- .../NodeJS/{ => Architecture}/Global_object.md | 2 +- Programming_Languages/NodeJS/Package_management.md | 14 ++++++++------ Software_Engineering/Call_stack.md | 5 +++-- Software_Engineering/Semantic_versioning.md | 8 +++----- 5 files changed, 20 insertions(+), 15 deletions(-) rename Programming_Languages/NodeJS/{ => Architecture}/Global_object.md (98%) diff --git a/Programming_Languages/NodeJS/Architecture/Event_loop.md b/Programming_Languages/NodeJS/Architecture/Event_loop.md index dffb14e..43a587c 100644 --- a/Programming_Languages/NodeJS/Architecture/Event_loop.md +++ b/Programming_Languages/NodeJS/Architecture/Event_loop.md @@ -69,4 +69,8 @@ The phases are as follows: * This phase can be targetted via the `process.exit()` function or the close event of a web-socket. -https://heynode.com/tutorial/how-event-loop-works-nodejs/ \ No newline at end of file +## Event _loop_ and event _queue_ + +The terms _event loop_ and _event queue_ are often used interchangeably in the literature but in fact they are distinct. + +The Event Loop is the Node runtime's method of execution, the queue is the stack of tasks that are lined up and executed by the loop. We can think of the queue as being the input and the loop as what acts on the input. The queue obviously emerges from the program we write but it is scheduled, organised and sequenced by the loop. \ No newline at end of file diff --git a/Programming_Languages/NodeJS/Global_object.md b/Programming_Languages/NodeJS/Architecture/Global_object.md similarity index 98% rename from Programming_Languages/NodeJS/Global_object.md rename to Programming_Languages/NodeJS/Architecture/Global_object.md index a0a0561..add9c10 100644 --- a/Programming_Languages/NodeJS/Global_object.md +++ b/Programming_Languages/NodeJS/Architecture/Global_object.md @@ -5,8 +5,8 @@ tags: - node-js --- +# Global object - > > In Node every function and variable should be scoped to a module. We should not define functions and variables within the global scope. * In Node the equivalent to the browser's `Window` object is `global`. The properties and methods that belong to this method are available anywhere in a program. diff --git a/Programming_Languages/NodeJS/Package_management.md b/Programming_Languages/NodeJS/Package_management.md index 4aaaa35..7b30956 100644 --- a/Programming_Languages/NodeJS/Package_management.md +++ b/Programming_Languages/NodeJS/Package_management.md @@ -6,13 +6,13 @@ tags: - npm --- +# Package management ## List installed packages -```` +```bash npm list -```` - -This will return a recursive tree that lists dependencies of dependencies, ... +``` +This will return a recursive tree that lists dependencies, dependences of dependencies, ... and so on. To limit the depth you can add the `--depth=` flag. For example to see only your installed packages and their versions use `npm list --depth=0`. ## View `package.json` data for an installed package @@ -24,7 +24,9 @@ We can pinpoint specific dependencies in the `package.json`, e.g. `npm view [pac ## View outdated modules See whether your dependency version is out of date use `npm outdated`. This gives us a table, for example: -![Pasted image 20220411082627.png](../../img/Pasted%20image%2020220411082627.png) + +![Pasted image 20220411082627.png](/img/Pasted_image_20220411082627.png) + * *Latest* tells us the latest release available from the developers * *Wanted* tells us the version that our `package.json` rules target. To take the first dependency as an example. We must have set our SemVer syntax to `^0.4.x` since it is telling us that there is a minor release that is more recent than the one we have installed but is not advising that we update to the latest major release. @@ -32,4 +34,4 @@ See whether your dependency version is out of date use `npm outdated`. This give ## Updating -`npm update` only updates from *current* to *wanted*. In other words it only updates in accordance with your caret and tilde rules applied to semantic versioning. +`npm update` only updates from *current* to *wanted*. In other words it only updates in accordance with your caret and tilde rules applied to [semantic versioning](/Software_Engineering/Semantic_versioning.md). diff --git a/Software_Engineering/Call_stack.md b/Software_Engineering/Call_stack.md index e04eeab..48ad290 100644 --- a/Software_Engineering/Call_stack.md +++ b/Software_Engineering/Call_stack.md @@ -24,6 +24,7 @@ console.log("Bye"); 2. Goes to the definition of this function (`function greet(who)...`) 3. Executes the `console.log` within this function 4. Returns to the location that called it (`greet("Harry")`) -5. Finds that there is nothing else to do in this function so moves to next function: the `console.log("bye") +5. Finds that there is nothing else to do in this function so moves to next function: the `console.log("bye")` 6. Executes -7. Returns to line that called it. Finds nothing else to do. Exits program \ No newline at end of file +7. Returns to line that called it. Finds nothing else to do. Exits program. + \ No newline at end of file diff --git a/Software_Engineering/Semantic_versioning.md b/Software_Engineering/Semantic_versioning.md index 5793944..70dc516 100644 --- a/Software_Engineering/Semantic_versioning.md +++ b/Software_Engineering/Semantic_versioning.md @@ -2,13 +2,11 @@ tags: - Software_Engineering --- +# Semantic versioning - -```` - +``` 3.4.1 === major.minor.patch - -```` +``` * Major