@@ -6,18 +6,19 @@ usage throughout the script. In k6, it is possible to import three different kin
6
6
7
7
## Importing modules
8
8
9
- While writing test scripts, it 's common to import different modules, or part of modules, for
10
- usage throughout the script. In k6, it is possible to import three different kinds of modules:
9
+ It 's common to import modules, or parts of modules, to use in your test scripts.
10
+ In k6, you can import three different kinds of modules:
11
11
12
12
- [ Built-in modules] ( #built-in-modules )
13
13
- [ Local filesystem modules] ( #local-filesystem-modules )
14
14
- [ Remote HTTP(S) modules] ( #remote-http-s-modules )
15
15
16
16
### Built-in modules
17
17
18
- These modules are provided through the k6 core, and gives access to the functionality built
19
- into k6. This could, for instance, be the ` http ` client used for making requests against the
20
- system under test. For a full list of built-in modules, see [ the API documentation] ( /javascript-api ) .
18
+ k6 provides many built-in modules for core functionalities.
19
+ For example, the ` http ` client make requests against the
20
+ system under test.
21
+ For the full list of built-in modules, refer to the [ the API documentation] ( /javascript-api ) .
21
22
22
23
``` javascript
23
24
import http from ' k6/http' ;
@@ -26,8 +27,8 @@ import http from 'k6/http';
26
27
### Local filesystem modules
27
28
28
29
These modules are stored on the local filesystem, and accessed either through relative
29
- or absolute filesystem paths. For a module residing in the local filesystem to be compatible
30
- with k6, the module itself may only use relative or absolute filesystem imports to access its
30
+ or absolute filesystem paths. To make local filesystem modules compatible
31
+ with k6, the module itself may use only relative or absolute filesystem imports to access its
31
32
dependencies.
32
33
33
34
``` javascript
@@ -49,8 +50,8 @@ export default function () {
49
50
### Remote HTTP(S) modules
50
51
51
52
These modules are accessed over HTTP(S), from a source like [ the k6 JSLib] ( #the-jslib-repository ) or
52
- from any publicly accessible web server. The imported modules will be downloaded and executed at
53
- runtime, making it extremely important to ** make sure the code is legit and trusted before including
53
+ from any publicly accessible web server. The imported modules are downloaded and executed at
54
+ runtime, making it extremely important to ** make sure you trust the code before including
54
55
it in a test script** .
55
56
56
57
``` javascript
@@ -63,9 +64,9 @@ export default function () {
63
64
64
65
### The JSLib repository
65
66
66
- ** JSLib** is a set of libraries known to play nicely with k6, and available at https://jslib.k6.io/ .
67
+ ** JSLib** is a set of libraries known to work well with k6. It is available at https://jslib.k6.io/ .
67
68
68
- These libraries can either be downloaded and included with the test project or loaded directly using HTTP imports as shown above .
69
+ These libraries can either be downloaded and included with the test project or loaded directly using HTTP imports.
69
70
70
71
## Bundling node modules
71
72
0 commit comments