1
00:00:00,450 --> 00:00:07,440
In this video, we are going to learn a very important topic, which is the actual script six requirements

2
00:00:07,740 --> 00:00:16,140
as you know that we have decided to use a script version three one interacting resources from our Node.js

3
00:00:16,140 --> 00:00:17,190
lambda functions.

4
00:00:17,580 --> 00:00:23,550
But before we proceed, we should understand the script six and it is requirements.

5
00:00:24,300 --> 00:00:27,090
Let me start with is the important part.

6
00:00:27,120 --> 00:00:34,380
During the course we will use a basic JavaScript version three and develop our codes ActionScript six

7
00:00:34,380 --> 00:00:35,280
standards.

8
00:00:36,410 --> 00:00:36,950
Yes.

9
00:00:36,950 --> 00:00:45,350
Six blinks, nips and tucks and new features to make our code more modern and readable and do more ES6

10
00:00:45,350 --> 00:00:52,310
requires to use Node.js version 13 or higher, and we have already downloaded the latest versions.

11
00:00:53,630 --> 00:00:56,340
So let's learn the basics of these topics.

12
00:00:56,360 --> 00:01:01,940
First of all, we should understand that there are two types of modal approaches in Node.js.

13
00:01:01,970 --> 00:01:03,660
The first one is the common JS.

14
00:01:03,680 --> 00:01:05,760
Then the second one is the most secure.

15
00:01:05,950 --> 00:01:12,560
Six And in some cases they are using different syntax, for example, import statements.

16
00:01:12,950 --> 00:01:22,400
In the import statements we can use Postscript five with the cost, but six requires the importing statement

17
00:01:22,400 --> 00:01:23,690
with the import keyword.

18
00:01:23,720 --> 00:01:25,880
Let me show you in this documentation.

19
00:01:25,880 --> 00:01:30,320
For example, let's open the API reference documentation of the Dynamo DB.

20
00:01:30,350 --> 00:01:37,010
If you scroll down and come to getting some part in the import statement, you can see the separation

21
00:01:37,010 --> 00:01:37,670
in here.

22
00:01:37,910 --> 00:01:45,440
At most scripts five requires the keyboard and script six, which is the latest version.

23
00:01:45,530 --> 00:01:47,590
It is required the import statement.

24
00:01:47,600 --> 00:01:54,680
If you continue the our slide, this is the first differentiation which is the import and statement

25
00:01:54,680 --> 00:01:59,540
and the second one is the export versus modal exports.

26
00:01:59,540 --> 00:02:06,980
So script six using the export keyword, but the all the versions using the modal exports.

27
00:02:07,490 --> 00:02:15,740
So another differentiate is adding type modal into the package JSON because script using the modularized

28
00:02:15,740 --> 00:02:16,830
package management.

29
00:02:16,850 --> 00:02:20,840
That's why we should provide into package days and type as a module.

30
00:02:20,840 --> 00:02:26,090
So these are the main differences from the script five and six.

31
00:02:26,090 --> 00:02:31,970
So we will use Postscript six also has good documentation about this topic.

32
00:02:32,000 --> 00:02:39,920
If you go to the this article, which is the JavaScript, ES6 and common JS syntax, it is basically

33
00:02:39,920 --> 00:02:46,460
explained how we can use Script six instead of the common JS and what is a syntax differentiation?

34
00:02:46,460 --> 00:02:47,540
Differentiation.

35
00:02:47,540 --> 00:02:48,920
So if you scroll down.

36
00:02:48,950 --> 00:02:55,970
Basically, if we continue the common JS, we should remove the type module information into the package

37
00:02:55,970 --> 00:03:01,250
JSON file and we should compare convert the all import statement to the code statement.

38
00:03:01,250 --> 00:03:07,610
So this is explaining that how we can downgrade the version as a common JS and using the execute five.

39
00:03:07,610 --> 00:03:10,550
But you understand the idea.

40
00:03:10,550 --> 00:03:16,460
If you would like to script six, we should use the import statement and we should add the type module

41
00:03:16,460 --> 00:03:18,400
information into package JSON file.

42
00:03:18,410 --> 00:03:20,780
And here is an example.

43
00:03:20,810 --> 00:03:25,520
There is a exporting module operation with the script six.

44
00:03:25,670 --> 00:03:32,360
It is using export keyword but in common JS execute five it is using module exports.

45
00:03:32,480 --> 00:03:40,490
So if we scroll down and here is the Amazon S3 creating any S3 bucket example with using the Script

46
00:03:40,580 --> 00:03:42,050
six and the common JS.

47
00:03:42,140 --> 00:03:48,230
If you look at the common JS, you can scroll down and see that it is importing the required package

48
00:03:48,230 --> 00:03:54,290
B using the keyword and it is exporting this module as a module that exports.

49
00:03:54,440 --> 00:04:01,640
And if you come back to our e-commerce script six, it is using the import keyword in order to import

50
00:04:01,640 --> 00:04:06,980
required package and it is exporting package with only export keyword.

51
00:04:07,010 --> 00:04:13,310
These are the main differences with using the common JS and the module script six.

52
00:04:13,610 --> 00:04:23,210
So we will follow these scripts during the course in order to gain this velocity and decrease our package

53
00:04:23,210 --> 00:04:23,810
size.

54
00:04:23,810 --> 00:04:30,170
So if we summarize that, we will use Node.js runtime when developing our lambda functions.

55
00:04:30,470 --> 00:04:37,280
And in lambda function we will interact with existing resources, for example, perform CRUD operations

56
00:04:37,280 --> 00:04:38,390
interacting with Dynamo.

57
00:04:38,390 --> 00:04:38,870
DB.

58
00:04:38,900 --> 00:04:45,230
So in this case we will use a SDK JavaScript version three libraries.

59
00:04:45,500 --> 00:04:52,100
So we will use version three because it has very important advantage about decreasing code size and

60
00:04:52,100 --> 00:04:53,630
modularized structure.

61
00:04:53,660 --> 00:04:57,230
This helps lot performance of Lambda Code start issues.

62
00:04:57,830 --> 00:05:05,360
And lastly, we use six modules when developing our Node.js Lambda functions in order to use latest

63
00:05:05,360 --> 00:05:06,760
modern syntax.

64
00:05:07,100 --> 00:05:15,170
To do that, we will add type module into our package JSON file and we will use import keywords and

65
00:05:15,170 --> 00:05:16,340
export keyword.

66
00:05:16,340 --> 00:05:23,150
When using the Node.js modules, I will share some useful resources into video, just resources about

67
00:05:23,150 --> 00:05:23,990
these topics.

68
00:05:23,990 --> 00:05:26,570
Nevertheless, please don't be overloaded.

69
00:05:26,600 --> 00:05:29,270
These are important but very easy to apply.

70
00:05:29,300 --> 00:05:31,970
We will do everything step by step and together.

71
00:05:32,000 --> 00:05:35,750
You don't miss any point during the course and these are the best.

72
00:05:36,010 --> 00:05:42,070
This is to develop modern lambda functions on a wireless environment that we will follow of these best

73
00:05:42,070 --> 00:05:44,170
practices in the enterprise applications.
