@investorphem/string-tools 1.0.1

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,44 @@
1
+ name: Auto Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ # 1️⃣ Checkout the repository
15
+ - uses: actions/checkout@v3
16
+
17
+ # 2️⃣ Setup Node.js and npm
18
+ - uses: actions/setup-node@v3
19
+ with:
20
+ node-version: '20'
21
+ registry-url: 'https://registry.npmjs.org/'
22
+
23
+ # 3️⃣ Install dependencies
24
+ - run: npm install
25
+
26
+ # 4️⃣ Optional: Run tests
27
+ - run: npm test || echo "No tests found, continuing..."
28
+
29
+ # 5️⃣ Configure Git for npm version commit
30
+ - name: Configure Git
31
+ run: |
32
+ git config user.name "GitHub Actions"
33
+ git config user.email "actions@github.com"
34
+
35
+ # 6️⃣ Auto-increment patch version
36
+ - name: Bump version
37
+ run: |
38
+ npm version patch -m "ci: bump version to %s"
39
+
40
+ # 7️⃣ Publish to npm
41
+ - name: Publish package
42
+ run: npm publish --access public
43
+ env:
44
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Oluwafemi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ @investorphem/string-tools
2
+
3
+
4
+
5
+
6
+ ---
7
+
8
+ Description
9
+
10
+ @investorphem/string-tools is a lightweight and robust collection of string utility functions for JavaScript developers. It includes commonly needed functions like capitalizing strings, converting to kebab-case, and reversing strings.
11
+
12
+ Installation
13
+
14
+ npm install @investorphem/string-tools
15
+
16
+ Usage
17
+
18
+ const { capitalize, kebabCase, reverse } = require('@investorphem/string-tools');
19
+
20
+ console.log(capitalize('hello')); // Hello
21
+ console.log(kebabCase('Hello World')); // hello-world
22
+ console.log(reverse('abc')); // cba
23
+
24
+ Functions
25
+
26
+ capitalize(str)
27
+
28
+ Capitalizes the first letter of the given string.
29
+
30
+ capitalize('hello'); // Hello
31
+
32
+ kebabCase(str)
33
+
34
+ Converts a string to kebab-case.
35
+
36
+ kebabCase('Hello World'); // hello-world
37
+
38
+ reverse(str)
39
+
40
+ Reverses the string.
41
+
42
+ reverse('abc'); // cba
43
+
44
+ Contributing
45
+
46
+ Contributions are welcome! Please fork the repository and submit pull requests. Ensure all tests pass before submitting.
47
+
48
+ License
49
+
50
+ This project is licensed under the MIT License.
51
+
52
+ Badges Explained
53
+
54
+ npm version: Shows the latest version on npm.
55
+
56
+ npm downloads: Shows total downloads from npm.
57
+
58
+ License: Shows the license type.
59
+
60
+ Build Status: Shows GitHub Action status for auto-publishing.
61
+
62
+
63
+
64
+ ---
65
+
66
+ Maintained by Oluwafemi Olagoke
package/index.js ADDED
@@ -0,0 +1,20 @@
1
+ // Capitalize the first letter of a string
2
+ function capitalize(str) {
3
+ if (!str) return "";
4
+ return str.charAt(0).toUpperCase() + str.slice(1);
5
+ }
6
+
7
+ // Convert a string to kebab-case
8
+ function kebabCase(str) {
9
+ return str
10
+ .replace(/\s+/g, "-")
11
+ .replace(/([a-z])([A-Z])/g, "$1-$2")
12
+ .toLowerCase();
13
+ }
14
+
15
+ // Reverse a string
16
+ function reverse(str) {
17
+ return str.split("").reverse().join("");
18
+ }
19
+
20
+ module.exports = { capitalize, kebabCase, reverse };
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@investorphem/string-tools",
3
+ "version": "1.0.1",
4
+ "main": "index.js",
5
+ "description": "Handy string utility functions for developers",
6
+ "scripts": {
7
+ "test": "node test.js"
8
+ },
9
+ "keywords": [
10
+ "string",
11
+ "utils",
12
+ "investorphem"
13
+ ],
14
+ "author": "Oluwafemi Olagoke",
15
+ "license": "MIT"
16
+ }