In this video, we are going to learn a very important topic, which is the actual script six requirements
as you know that we have decided to use a script version three one interacting resources from our Node.js
lambda functions.
But before we proceed, we should understand the script six and it is requirements.
Let me start with is the important part.
During the course we will use a basic JavaScript version three and develop our codes ActionScript six
standards.
Yes.
Six blinks, nips and tucks and new features to make our code more modern and readable and do more ES6
requires to use Node.js version 13 or higher, and we have already downloaded the latest versions.
So let's learn the basics of these topics.
First of all, we should understand that there are two types of modal approaches in Node.js.
The first one is the common JS.
Then the second one is the most secure.
Six And in some cases they are using different syntax, for example, import statements.
In the import statements we can use Postscript five with the cost, but six requires the importing statement
with the import keyword.
Let me show you in this documentation.
For example, let's open the API reference documentation of the Dynamo DB.
If you scroll down and come to getting some part in the import statement, you can see the separation
in here.
At most scripts five requires the keyboard and script six, which is the latest version.
It is required the import statement.
If you continue the our slide, this is the first differentiation which is the import and statement
and the second one is the export versus modal exports.
So script six using the export keyword, but the all the versions using the modal exports.
So another differentiate is adding type modal into the package JSON because script using the modularized
package management.
That's why we should provide into package days and type as a module.
So these are the main differences from the script five and six.
So we will use Postscript six also has good documentation about this topic.
If you go to the this article, which is the JavaScript, ES6 and common JS syntax, it is basically
explained how we can use Script six instead of the common JS and what is a syntax differentiation?
Differentiation.
So if you scroll down.
Basically, if we continue the common JS, we should remove the type module information into the package
JSON file and we should compare convert the all import statement to the code statement.
So this is explaining that how we can downgrade the version as a common JS and using the execute five.
But you understand the idea.
If you would like to script six, we should use the import statement and we should add the type module
information into package JSON file.
And here is an example.
There is a exporting module operation with the script six.
It is using export keyword but in common JS execute five it is using module exports.
So if we scroll down and here is the Amazon S3 creating any S3 bucket example with using the Script
six and the common JS.
If you look at the common JS, you can scroll down and see that it is importing the required package
B using the keyword and it is exporting this module as a module that exports.
And if you come back to our e-commerce script six, it is using the import keyword in order to import
required package and it is exporting package with only export keyword.
These are the main differences with using the common JS and the module script six.
So we will follow these scripts during the course in order to gain this velocity and decrease our package
size.
So if we summarize that, we will use Node.js runtime when developing our lambda functions.
And in lambda function we will interact with existing resources, for example, perform CRUD operations
interacting with Dynamo.
DB.
So in this case we will use a SDK JavaScript version three libraries.
So we will use version three because it has very important advantage about decreasing code size and
modularized structure.
This helps lot performance of Lambda Code start issues.
And lastly, we use six modules when developing our Node.js Lambda functions in order to use latest
modern syntax.
To do that, we will add type module into our package JSON file and we will use import keywords and
export keyword.
When using the Node.js modules, I will share some useful resources into video, just resources about
these topics.
Nevertheless, please don't be overloaded.
These are important but very easy to apply.
We will do everything step by step and together.
You don't miss any point during the course and these are the best.
This is to develop modern lambda functions on a wireless environment that we will follow of these best
practices in the enterprise applications.