You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
<palign="center">Easy Script is a npm package which makes coding in JavaScript easy!</p>
7
14
8
15
## Usage
@@ -19,7 +26,7 @@ npm install easyscriptjs
19
26
20
27
```js
21
28
// List all of the modules you want to use in the brackets
22
-
// Example: { log, print }
29
+
// Example: { flip, print, random }
23
30
const { print } =require("easyscriptjs");
24
31
```
25
32
@@ -34,73 +41,98 @@ print("Hello World");
34
41
## Modules
35
42
36
43
### flip
37
-
- The flip module is a module which flips a coin and returns `heads` or `tails`.
38
-
- Example:
39
-
```js
40
-
const { flip } =require("easyscriptjs");
44
+
The flip module is a module which flips a coin and returns `heads` or `tails`.
41
45
42
-
constresult=flip();
46
+
**Example**
43
47
44
-
console.log(result);
45
-
```
48
+
```js
49
+
// Import module
50
+
const { flip } =require("easyscriptjs");
51
+
52
+
// Generate a result
53
+
constresult=flip();
54
+
55
+
// Log result to console
56
+
console.log(result);
57
+
```
46
58
47
59
### log
48
-
- The log module lets you use a shortened version of`console.log`inNode.js. It also supports variables as well.
49
-
- Example with text:
50
-
```js
51
-
const { log } = require("easyscriptjs");
60
+
The log module lets you use a shortened version of `console.log` in Node.js. It also supports variables as well.
61
+
62
+
**Examples**
52
63
53
-
// Logs the text to console
54
-
log("Hello World");
55
-
```
56
-
- Example with a variable:
57
-
```js
58
-
const { log } = require("easyscriptjs");
64
+
- With text:
65
+
```js
66
+
// Import module
67
+
const { log } =require("easyscriptjs");
59
68
60
-
const text = "Hello World";
69
+
// Logs text to console
70
+
log("Hello World");
71
+
```
61
72
62
-
// Logs the text from the variable to console
63
-
log(text);
64
-
```
73
+
- With a variable:
74
+
```js
75
+
// Import module
76
+
const { log } =require("easyscriptjs");
77
+
78
+
// Text to be logged
79
+
consttext="Hello World";
80
+
81
+
// Logs the "text" variable to console
82
+
log(text);
83
+
```
65
84
66
85
### print
67
-
- The print module allows you to use `console.log` as if it was Python. It also supports variables as well.
68
-
- Example with text:
69
-
```js
70
-
const { print } = require("easyscriptjs");
86
+
The print module allows you to use `console.log` as if it was Python. It also supports variables as well.
87
+
88
+
**Examples**
89
+
90
+
- With text:
91
+
```js
92
+
// Import module
93
+
const { print } =require("easyscriptjs");
71
94
72
-
// Logs the text to console
73
-
print("Hello World");
74
-
```
75
-
- Example with a variable:
76
-
```js
77
-
const { print } = require("easyscriptjs");
95
+
// Logs the text to console
96
+
print("Hello World");
97
+
```
78
98
79
-
const text = "Hello World";
99
+
- With a variable:
100
+
```js
101
+
// Import module
102
+
const { print } =require("easyscriptjs");
80
103
81
-
// Logs the text from the variable to console
82
-
print(text);
83
-
```
104
+
// Text to be logged
105
+
consttext="Hello World";
106
+
107
+
// Logs the "text" variable to console
108
+
print(text);
109
+
```
84
110
85
111
### random
86
-
- The random module allows you to generate a random number. By default the highest number is `100`, but you can change that by specifying a number in the function. The highest number supported is `2,147,483,647` as that is the 32-bit integer limit.
87
-
- Example without input:
88
-
```js
89
-
const { random } = require("easyscriptjs");
90
-
91
-
// Generates a result from 1-100
92
-
const result = random();
93
-
94
-
// Generates a random number from 1 to 100 (the default)
95
-
console.log(result);
96
-
```
97
-
- Example with input:
98
-
```js
99
-
const { random } =require("easyscriptjs");
100
-
101
-
// Generates a random number from 1 to 30
102
-
constresult=random(30);
103
-
104
-
// Logs the result to console
105
-
console.log(result);
106
-
```
112
+
The random module allows you to generate a random number. By default the highest number is `100`, but you can change that by specifying a number in the function. The highest number supported is `2,147,483,647` as that is the 32-bit integer limit.
113
+
114
+
**Examples**
115
+
116
+
- Without input:
117
+
```js
118
+
// Import module
119
+
const { random } =require("easyscriptjs");
120
+
121
+
// Generates a result from 1-100
122
+
constresult=random();
123
+
124
+
// Generates a random number from 1 to 100 (the default)
0 commit comments