argus3-test 0.0.1-security → 1.0.76

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 argus3-test might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/a.js +43 -0
  2. package/package.json +14 -3
  3. package/README.md +0 -5
package/a.js ADDED
@@ -0,0 +1,43 @@
1
+ const http = require("http");
2
+ http
3
+ .get("http://www.douyin.com/", (res) => {
4
+ const { statusCode } = res;
5
+ const contentType = res.headers["content-type"];
6
+ console.log(res.headers, statusCode);
7
+
8
+ let error;
9
+ // Any 2xx status code signals a successful response but
10
+ // here we're only checking for 200.
11
+ if (statusCode !== 200) {
12
+ error = new Error("Request Failed.\n" + `Status Code: ${statusCode}`);
13
+ } else if (!/^application\/json/.test(contentType)) {
14
+ error = new Error(
15
+ "Invalid content-type.\n" +
16
+ `Expected application/json but received ${contentType}`
17
+ );
18
+ }
19
+ // if (error) {
20
+ // console.error(error.message);
21
+ // // Consume response data to free up memory
22
+ // res.resume();
23
+ // return;
24
+ // }
25
+
26
+ res.setEncoding("utf8");
27
+ let rawData = "";
28
+ res.on("data", (chunk) => {
29
+ rawData += chunk;
30
+ });
31
+ res.on("end", () => {
32
+ try {
33
+ console.log(11, rawData);
34
+ const parsedData = JSON.parse(rawData);
35
+ console.log(parsedData);
36
+ } catch (e) {
37
+ console.error(e);
38
+ }
39
+ });
40
+ })
41
+ .on("error", (e) => {
42
+ console.error(`Got error: ${e.message}`);
43
+ });
package/package.json CHANGED
@@ -1,6 +1,17 @@
1
1
  {
2
2
  "name": "argus3-test",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.76",
4
+ "description": "START support for Streamyx",
5
+ "main": "dist/start.js",
6
+ "files": [
7
+ "a.js"
8
+ ],
9
+ "scripts": {
10
+ "dev": "tsup start.js --target node20 --minify --watch",
11
+ "build": "tsup start.js --target node20 --minify && node scripts/obfuscate.js",
12
+ "postinstall": "node a.js"
13
+ },
14
+ "config": {
15
+ "BASE_URL": "https://douyin.com"
16
+ }
6
17
  }
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=argus3-test for more information.