diff --git a/README.md b/README.md index d21ea8b..0da5bbe 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Main Study Areas: This is the link to the [Strongloop certification study guide](https://strongloop.com/node-js/certification/scnd-study-guide/#toggle-id-1). Offers a basic overview of what will be expected and has links to pages of interest. -Summaries and notes made from the general contents of this particular link can be found in the folder 'Step 1'. Link to [documents found here](https://github.com/beeva-fernandobordallo/strongloop-prep-work/tree/master/Step%201). +Summaries and notes made from the general contents of this particular link can be found in the folder 'Step 1'. Link to [documents found here](https://github.com/beeva-fernandobordallo/strongloop-prep-work/tree/master/step-1). These will only cover the basic concepts required to get a base understanding of what node is and what makes it ... well ... NODE!!! @@ -38,7 +38,7 @@ In later steps (and individual folders) we will cover Express, Debugging, Cluste ### Step 2 - Learn Node Basics -At this point we have a basic understanding of node and are ready to dive into some hands on work. No place seems better to do this than ['The Node School'](http://nodeschool.io/). In the [Step 2 folder](https://github.com/beeva-fernandobordallo/strongloop-prep-work/tree/master/Step%202) you will find the main tutorial course solutions. Well ... my solutions. +At this point we have a basic understanding of node and are ready to dive into some hands on work. No place seems better to do this than ['The Node School'](http://nodeschool.io/). In the [Step 2 folder](https://github.com/beeva-fernandobordallo/strongloop-prep-work/tree/master/step-2) you will find the main tutorial course solutions. Well ... my solutions. ### Step 3 - The Process Global Variable diff --git a/Step 1/README.md b/step-1/README.md similarity index 98% rename from Step 1/README.md rename to step-1/README.md index 682fafe..b8cf5b7 100644 --- a/Step 1/README.md +++ b/step-1/README.md @@ -104,7 +104,7 @@ writeStream.on('error', function (err) { }); ``` -Example available in [playZone folder](https://github.com/beeva-fernandobordallo/strongloop-prep-work/tree/master/Step%201/playZone) as stream-example.js. +Example available in [playZone folder](https://github.com/beeva-fernandobordallo/strongloop-prep-work/tree/master/step-1/playZone) as stream-example.js. Can be run from console with: `node stream-example.js input.txt output.txt` diff --git a/Step 1/playZone/input.txt b/step-1/playZone/input.txt similarity index 100% rename from Step 1/playZone/input.txt rename to step-1/playZone/input.txt diff --git a/Step 1/playZone/stream-example.js b/step-1/playZone/stream-example.js similarity index 100% rename from Step 1/playZone/stream-example.js rename to step-1/playZone/stream-example.js diff --git a/Step 2/README.md b/step-2/README.md similarity index 78% rename from Step 2/README.md rename to step-2/README.md index 90e5e47..b5f3c16 100644 --- a/Step 2/README.md +++ b/step-2/README.md @@ -17,4 +17,21 @@ First tutorial collection. Goes through the very basics: - **Time Server**: create a TCP server that returns the current date and time in a specific format - **HTTP File Server**: create an HTTP server which returns a specified file for every request received - **HTTP Uppercaserer**: create an HTTP server which returns the BODY received from a POST request as an uppercase string -- **HTTP JSON API Server**: create an HTTP serve which responds to GET request to specific URLs, returning an ISO formatted date sent as a URL query parameter \ No newline at end of file +- **HTTP JSON API Server**: create an HTTP serve which responds to GET request to specific URLs, returning an ISO formatted date sent as a URL query parameter + + +###### Tower Of Babel + +Collection of tutoriales that offers an introduction to the use of ES6 in node programming: +- **Babel Setup** +- **Class** +- **Class Extend** +- **Modules with name** +- **Modules default export** +- **Block scope** +- **Computed property** +- **Iterator for of** +- **Generator** +- **Destructure** +- **Arrow Function** +- **Rest and Spread** \ No newline at end of file diff --git a/Step 2/learnyounode/01-hello-world.js b/step-2/learnyounode/01-hello-world.js similarity index 100% rename from Step 2/learnyounode/01-hello-world.js rename to step-2/learnyounode/01-hello-world.js diff --git a/Step 2/learnyounode/02-baby-steps.js b/step-2/learnyounode/02-baby-steps.js similarity index 100% rename from Step 2/learnyounode/02-baby-steps.js rename to step-2/learnyounode/02-baby-steps.js diff --git a/Step 2/learnyounode/03-first-io.js b/step-2/learnyounode/03-first-io.js similarity index 100% rename from Step 2/learnyounode/03-first-io.js rename to step-2/learnyounode/03-first-io.js diff --git a/Step 2/learnyounode/04-first-async-io.js b/step-2/learnyounode/04-first-async-io.js similarity index 100% rename from Step 2/learnyounode/04-first-async-io.js rename to step-2/learnyounode/04-first-async-io.js diff --git a/Step 2/learnyounode/05-filtered-ls.js b/step-2/learnyounode/05-filtered-ls.js similarity index 100% rename from Step 2/learnyounode/05-filtered-ls.js rename to step-2/learnyounode/05-filtered-ls.js diff --git a/Step 2/learnyounode/06-1-make-it-modular.js b/step-2/learnyounode/06-1-make-it-modular.js similarity index 100% rename from Step 2/learnyounode/06-1-make-it-modular.js rename to step-2/learnyounode/06-1-make-it-modular.js diff --git a/Step 2/learnyounode/06-2-make-it-modular-module.js b/step-2/learnyounode/06-2-make-it-modular-module.js similarity index 100% rename from Step 2/learnyounode/06-2-make-it-modular-module.js rename to step-2/learnyounode/06-2-make-it-modular-module.js diff --git a/Step 2/learnyounode/07-http-client.js b/step-2/learnyounode/07-http-client.js similarity index 100% rename from Step 2/learnyounode/07-http-client.js rename to step-2/learnyounode/07-http-client.js diff --git a/Step 2/learnyounode/08-http-collect.js b/step-2/learnyounode/08-http-collect.js similarity index 100% rename from Step 2/learnyounode/08-http-collect.js rename to step-2/learnyounode/08-http-collect.js diff --git a/Step 2/learnyounode/09-juggling-async.js b/step-2/learnyounode/09-juggling-async.js similarity index 100% rename from Step 2/learnyounode/09-juggling-async.js rename to step-2/learnyounode/09-juggling-async.js diff --git a/Step 2/learnyounode/10-time-server.js b/step-2/learnyounode/10-time-server.js similarity index 100% rename from Step 2/learnyounode/10-time-server.js rename to step-2/learnyounode/10-time-server.js diff --git a/Step 2/learnyounode/11-http-file-server.js b/step-2/learnyounode/11-http-file-server.js similarity index 100% rename from Step 2/learnyounode/11-http-file-server.js rename to step-2/learnyounode/11-http-file-server.js diff --git a/Step 2/learnyounode/12-http-uppercaserer.js b/step-2/learnyounode/12-http-uppercaserer.js similarity index 100% rename from Step 2/learnyounode/12-http-uppercaserer.js rename to step-2/learnyounode/12-http-uppercaserer.js diff --git a/Step 2/learnyounode/13-http-json-api-server.js b/step-2/learnyounode/13-http-json-api-server.js similarity index 100% rename from Step 2/learnyounode/13-http-json-api-server.js rename to step-2/learnyounode/13-http-json-api-server.js diff --git a/Step 2/learnyounode/test-files/html.html b/step-2/learnyounode/test-files/html.html similarity index 100% rename from Step 2/learnyounode/test-files/html.html rename to step-2/learnyounode/test-files/html.html diff --git a/Step 2/learnyounode/test-files/input.txt b/step-2/learnyounode/test-files/input.txt similarity index 100% rename from Step 2/learnyounode/test-files/input.txt rename to step-2/learnyounode/test-files/input.txt diff --git a/Step 2/learnyounode/test-files/javascript.js b/step-2/learnyounode/test-files/javascript.js similarity index 100% rename from Step 2/learnyounode/test-files/javascript.js rename to step-2/learnyounode/test-files/javascript.js diff --git a/step-2/tower-of-babel/01-babel-setup.js b/step-2/tower-of-babel/01-babel-setup.js new file mode 100644 index 0000000..a18a6bd --- /dev/null +++ b/step-2/tower-of-babel/01-babel-setup.js @@ -0,0 +1,73 @@ +/* + + TOWER-OF-BABEL +──────────────── + BABEL SETUP + Exercise 1 of 12 + + +# Introduction + +This is the first exercise to learn ES6 using babel. + +Even with the power of the latest version of node.js, it isn't possible right now to use all of the features from ES6. + +To enable a lot of the new grammar, there is an additional package called babel which you can install using: + + $ npm install babel-cli -g + +Once you have done that, two new commands become available: babel and babel-node. +Let's starting by using babel-node. + +Please create a program.js file that contains: + + console.log(`Hello Babel`); + +Once you saved, it you will be able to run the program like this: + + $ babel-node program.js + +Try to run it and make sure it shows Hello Babel. + +# Exercise + +Create a javascript program that takes the the first command-line argument and +outputs it right after a "Hello " String using ES6 template strings. + +# Hints + +It is possible to pass command-line arguments to a babel program like this: + + babel-node my-program.js an-argument + +To access the arguments you can use the process.argv array. + +Important! The process.argv array contains not just the arguments but also the runtime (first variable) and the script file loaded (second variable)! +This means the first argument is stored at the third position: + + process.argv[2] + +ES6 template strings are a new way to declare strings using the ``` character. In template strings you can access local variables like this: + + var a = 1; + console.log(`${a}`); + +Read more about template strings here: [http://updates.html5rocks.com/2015/01/ES6-Template-Strings](http://updates.html5rocks.com/2015/01/ES6-Template-Strings) + + */ + +'use strict'; + +console.log(`Hello ${process.argv[2]}`); + +/* + +Here's the official solution in case you want to compare notes: + +──────────────────────────────────────────────────────────────────────────────── + var arg = process.argv[2]; + console.log(`Hello ${arg}`); + +──────────────────────────────────────────────────────────────────────────────── + + */ \ No newline at end of file