stack-analyze 1.1.9 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ import { scrapingOpts } from "../utils.js";
2
+
3
+ const webRegex = /https?:\/\//g;
4
+
5
+ const singleWebQuery = {
6
+ name: "url",
7
+ message: "enter a url:",
8
+ validate: input => webRegex.test(input) || "enter a url valid".yellow
9
+ };
10
+
11
+ const multipleWebQuery = {
12
+ name: "webList",
13
+ message: "enter URLs for analyze the tech stacks with whitespace without quotes example 'http://example.com https://nodejs.org': \n",
14
+ validate(input) {
15
+ const pass = input.match(webRegex);
16
+
17
+ return pass && pass.length === 2 || "must be 2 sites";
18
+ }
19
+ };
20
+
21
+ const webScrapingQuery = {
22
+ type: "list",
23
+ pageSize: 9,
24
+ name: "option",
25
+ message: "select a web scraping option:",
26
+ choices: scrapingOpts
27
+ };
28
+
29
+ export {
30
+ singleWebQuery,
31
+ multipleWebQuery,
32
+ webScrapingQuery
33
+ };
package/demo.js DELETED
@@ -1,20 +0,0 @@
1
- import inquirer from 'inquirer';
2
-
3
- inquirer
4
- .prompt([
5
- {
6
- type: "input",
7
- name: "username",
8
- message: "What's your name?"
9
- }
10
- ])
11
- .then((answers) => {
12
- console.log(`Hello ${answers.username}!`)
13
- })
14
- .catch((error) => {
15
- if (error.isTtyError) {
16
- console.log("Your console environment is not supported!")
17
- } else {
18
- console.log(error)
19
- }
20
- })