UNPKG

3.66 kBMarkdownView Raw
1<!-- toc -->
2
3- [Group1](#group1)
4 * [parcel:script](#parcelscript)
5 * [script:js](#scriptjs)
6- [Groups2](#groups2)
7 * [console:js](#consolejs)
8 * [input:js-](#inputjs-)
9 * [crazy:javascript](#crazyjavascript)
10
11<!-- tocstop -->
12
13# Group1
14
15Explained G 1
16
17## parcel:script
18
19Described script 1
20
21```bash
22parcel ./index.html --no-cache
23```
24
25## script:js
26
27```js
28const chalk = require("chalk");
29console.log(`${chalk.underline.bold("RUNS JS\n\nTEST")}`);
30```
31
32# Groups2
33
34## console:js
35
36Only one script here with bash
37
38```bash
39node src/sampleScripts/exampleLogTimeout.js
40```
41
42## input:js-
43
44Get some input from user
45
46```bash
47node src/sampleScripts/exampleInput.js
48```
49
50## crazy:javascript
51
52```js
53const chalk = require("chalk");
54const sample = arr => arr[Math.floor(Math.random() * arr.length)];
55const quotes = [
56 "The trickster's functiowhat they reslly s function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they res function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they rewant, some sort of freedom. - Tom Robbins",
57 '"Disbelief in magic can really s function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they res function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they rewant, some sort of freedom. - Tom Robbins",\n' +
58 ' "Disbelief in magic can force a poor soul into believing in government and business. - Tom Robbins',
59 'The trouble with the fasforce a poor soul into believing in government and business. - Tom Robbins",\n' +
60 ' "The trouble with the fasforce a poor soul into believing in government and business. - Tom Robbins",\n' +
61 ' "The trouble with the fast lane is that all the movement is horizontal. And I like to go vertical sometimes. - Tom Robbins',
62 "Our world isn't made of earth, air and water or even molecules and atoms; our world is made of language. - Tom Robbimade of earth, air and water or even molecules and atoms; our world is made of language. - Tom Robbins",
63 "I'm not infatuated with frivoith frivoith frivoith frivoith frivoith frivoith frivoith frivolousness. We're just good friends. - Tom Robbins",
64 "In fiction, when you paint yourself into a corner, you can write a pair of suction cups onto the bottoms of your shoes and walk up the wall and out the skylight and see the sun breaking through the clouds. In nonfiction, you don't have that luxury. - Tom Robbins"
65];
66let sxy;
67const getOption = st => {
68 // if (Math.random() > 0.5) {
69 // st = st + sample(quotes) + sample(quotes) + sample(quotes);
70 // }
71 let options = [
72 chalk.blue(st),
73 chalk.underline.green(st),
74 chalk.green.bgRed.bold(st),
75 chalk.blue(st, st, st, st),
76 chalk.red(st, chalk.underline.bgBlue(st) + st)
77 ];
78 return sample(options);
79};
80let isMil = 0;
81const theRun = async () => {
82 return new Promise(resolve => {
83 sxy = setInterval(() => {
84 const qt = sample(quotes);
85 console.log(new Date() + " ------- ----- ---- \n");
86 console.log(getOption(qt));
87 console.log(new Date() + " ------- ----- ---- \n");
88 console.log("----- ---- \n");
89 console.log("----- ---- \n");
90 console.log("----- ---- \n");
91 if (isMil === 30) {
92 clearInterval(sxy);
93 console.log("DONE DONE DONE");
94 resolve();
95 } else {
96 isMil += 10;
97 }
98 }, 1000);
99 });
100};
101
102theRun();
103```