supplysec-alert 0.0.1-security → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of supplysec-alert might be problematic. Click here for more details.
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/supplysec-alert.iml +12 -0
- package/index.js +49 -0
- package/package.json +11 -3
- package/README.md +0 -5
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/supplysec-alert.iml" filepath="$PROJECT_DIR$/.idea/supplysec-alert.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="WEB_MODULE" version="4">
|
3
|
+
<component name="NewModuleRootManager">
|
4
|
+
<content url="file://$MODULE_DIR$">
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
8
|
+
</content>
|
9
|
+
<orderEntry type="inheritedJdk" />
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
11
|
+
</component>
|
12
|
+
</module>
|
package/index.js
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
const fs = require('fs')
|
2
|
+
const https = require('https')
|
3
|
+
|
4
|
+
function writeFile() {
|
5
|
+
fs.writeFile('/tmp/test.txt', "write file test", err => {
|
6
|
+
if (err) {
|
7
|
+
console.error(err)
|
8
|
+
}
|
9
|
+
})
|
10
|
+
}
|
11
|
+
|
12
|
+
function readFile() {
|
13
|
+
console.log("read file")
|
14
|
+
fs.readFile('/tmp/test.txt', 'utf8', (err, data) => {
|
15
|
+
if (err) {
|
16
|
+
console.error(err)
|
17
|
+
return
|
18
|
+
}
|
19
|
+
console.log(data)
|
20
|
+
})
|
21
|
+
}
|
22
|
+
|
23
|
+
function httpReq() {
|
24
|
+
console.log("http");
|
25
|
+
const options = {
|
26
|
+
hostname: 'baidu.com',
|
27
|
+
port: 443,
|
28
|
+
path: '/',
|
29
|
+
method: 'GET'
|
30
|
+
}
|
31
|
+
|
32
|
+
const req = https.request(options, res => {
|
33
|
+
console.log(`状态码: ${res.statusCode}`)
|
34
|
+
|
35
|
+
res.on('data', d => {
|
36
|
+
process.stdout.write(d)
|
37
|
+
})
|
38
|
+
})
|
39
|
+
|
40
|
+
req.on('error', error => {
|
41
|
+
console.error(error)
|
42
|
+
})
|
43
|
+
|
44
|
+
req.end()
|
45
|
+
}
|
46
|
+
|
47
|
+
writeFile();
|
48
|
+
readFile();
|
49
|
+
httpReq();
|
package/package.json
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "supplysec-alert",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.0.1",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "echo \"hacked\"",
|
9
|
+
"postinstall": "node index.js"
|
10
|
+
},
|
11
|
+
"keywords": [],
|
12
|
+
"author": "",
|
13
|
+
"license": "ISC"
|
6
14
|
}
|
package/README.md
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
# Security holding package
|
2
|
-
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
4
|
-
|
5
|
-
Please refer to www.npmjs.com/advisories?search=supplysec-alert for more information.
|