azpepoze.node_tools 1.0.0 → 1.0.3

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,35 @@
1
+ name: Node.js Package
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ publish-gpr:
10
+ environment: NPM
11
+
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 20
24
+
25
+ - name: Install pnpm
26
+ run: npm install -g pnpm
27
+
28
+ - name: Install dependencies
29
+ run: pnpm install --frozen-lockfile
30
+
31
+ # Publish to npm Registry
32
+ - name: Publish to npm Registry
33
+ run: |
34
+ pnpm config set '//registry.npmjs.org/:_authToken' "${{secrets.NPM_TOKEN}}"
35
+ pnpm publish --access public
package/index.js CHANGED
@@ -1,27 +1,27 @@
1
- const fs = require("fs");
2
-
3
- /**
4
- * Replaces content in a file based on a regular expression.
5
- *
6
- * @param {string} path - The path to the file.
7
- * @param {RegExp} regex - The regular expression to match the content to replace.
8
- * @param {string} target - The string to replace the matched content with.
9
- */
10
- function File_Content_Replace(path, regex, target) {
11
- try {
12
- // Read the file content
13
- const content = fs.readFileSync(path, "utf8");
14
-
15
- // Replace the content using the regex and target
16
- const updatedContent = content.replace(regex, target);
17
-
18
- // Write the updated content back to the file
19
- fs.writeFileSync(path, updatedContent, "utf8");
20
-
21
- console.log(`File updated successfully: ${path}`);
22
- } catch (error) {
23
- console.error(`Error processing the file at ${path}:`, error);
24
- }
25
- }
26
-
1
+ const fs = require("fs");
2
+
3
+ /**
4
+ * Replaces content in a file based on a regular expression.
5
+ *
6
+ * @param {string} path - The path to the file.
7
+ * @param {RegExp} regex - The regular expression to match the content to replace.
8
+ * @param {string} target - The string to replace the matched content with.
9
+ */
10
+ function File_Content_Replace(path, regex, target) {
11
+ try {
12
+ // Read the file content
13
+ const content = fs.readFileSync(path, "utf8");
14
+
15
+ // Replace the content using the regex and target
16
+ const updatedContent = content.replace(regex, target);
17
+
18
+ // Write the updated content back to the file
19
+ fs.writeFileSync(path, updatedContent, "utf8");
20
+
21
+ console.log(`File updated successfully: ${path}`);
22
+ } catch (error) {
23
+ console.error(`Error processing the file at ${path}:`, error);
24
+ }
25
+ }
26
+
27
27
  module.exports = { File_Content_Replace };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
- "name": "azpepoze.node_tools",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "index.js",
6
- "keywords": [
7
- "AzPepoze",
8
- "az_node_tools"
9
- ],
10
- "author": "AzPepoze",
11
- "license": "MIT",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/AzPepoze/Az_Node_Tools"
15
- }
16
- }
2
+ "name": "azpepoze.node_tools",
3
+ "version": "1.0.3",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "keywords": [
7
+ "AzPepoze",
8
+ "az_node_tools"
9
+ ],
10
+ "author": "AzPepoze",
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/AzPepoze/AzPepoze.Node_Tools"
15
+ }
16
+ }