Skip to content

Commit c7f9c8a

Browse files
committed
refactor: reduce internal docs
docs: refactored readme.md
1 parent 7f36987 commit c7f9c8a

File tree

8 files changed

+53
-270
lines changed

8 files changed

+53
-270
lines changed

README.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A lightweight and versatile String Utility Package for Node.js & Browser.
99
<img src="https://user-images.githubusercontent.com/6517308/121813242-859a9700-cc6b-11eb-99c0-49e5bb63005b.jpg">
1010

1111
# Contents
12+
1213
* [Install](#install)
1314
* [require](#require)
1415
* [import](#import)
@@ -37,14 +38,11 @@ A lightweight and versatile String Utility Package for Node.js & Browser.
3738
* [isAlpha](#isalpha)
3839
* [isAlphaNumeric](#isalphanumeric)
3940
* [reverse](#reverse)
40-
41-
(Coming Soon)
42-
* [StringBuilder](#)
43-
* [StringValidator](#)
4441
* [Build](#build)
4542
* [License](#license)
4643

47-
## install
44+
## Install
45+
4846
```sh
4947
npm install @full-pack/string-pack
5048
```
@@ -61,13 +59,16 @@ const { ... } = require('@full-pack/string-pack');
6159
import { ... } from '@full-pack/string-pack';
6260
```
6361

64-
## API
62+
## APIs
63+
64+
### Padding
6565

66-
### padding
6766
Adds padding to given string.
6867

6968
##### padStart
69+
7070
Pads the start of a string with a specified fill string a certain number of times.
71+
7172
```js
7273
// Basic Usage
7374
padStart('hello', 'abc', 3) // abcabcabchello
@@ -77,7 +78,9 @@ padStart('hello', 'abc', 3, 8) // abchello
7778
```
7879

7980
##### padEnd
81+
8082
Pads the end of a string with a specified fill string a certain number of times.
83+
8184
```js
8285
// Basic Usage
8386
padEnd('hello', 'abc', 3); // helloabcabcabc
@@ -87,7 +90,9 @@ padEnd('hello', 'abc', 3, 8); // helloabc
8790
```
8891

8992
##### padBidirectional
93+
9094
Pads a string with a specified fill string a certain number of times on both ends.
95+
9196
```js
9297
// Basic usage
9398
padBidirectional('hello', '*', {repeatCount: 2}); // '**hello**'
@@ -101,7 +106,9 @@ padBidirectional('example', '*', {repeatCount: 2, maxLen: 10, bias: PaddingBias.
101106
```
102107

103108
### merge
109+
104110
Merges an array of strings into a single string using a specified separator.
111+
105112
```js
106113
merge('-', 'apple', 'orange', 'banana'); // 'apple-orange-banana'
107114

@@ -111,31 +118,39 @@ merge(false, 'apple', 'orange', 'banana'); // 'appleorangebanana'
111118
```
112119

113120
### compare
121+
114122
Performs a strict comparison between two strings.
123+
115124
```js
116125
compare("hello", "hello"); // true
117126

118127
compare("abc", "ABC"); // false
119128
```
120129

121130
### looseCompare
131+
122132
Performs a case-insensitive loose comparison between two strings.
133+
123134
```js
124135
looseCompare("hello", "HELLO"); // true
125136

126137
looseCompare('abc', '123'); // false
127138
```
128139

129140
### capitalizeInitial
141+
130142
Capitalizes the first letter of a word in a string.
143+
131144
```js
132145
capitalizeInitial('hello'); // 'Hello'
133146

134147
capitalizeInitial(':> hello'); // ':> Hello'
135148
```
136149

137150
### capitalizeWords
151+
138152
Capitalizes the first letter of each word in a given string.
153+
139154
```js
140155
capitalizeWords('hello world'); // 'Hello World'
141156

@@ -145,31 +160,39 @@ capitalizeWords('Sphinx of black quartz:-judge my vow'); // 'Sphinx Of Black Qua
145160
### Case Conversion
146161

147162
#### snakeCase
163+
148164
Converts a string to snake_case format.
165+
149166
```js
150167
snakeCase('hello WorLd'); // 'hello_world'
151168
snakeCase('from-kebab-case'); // 'from_kebab_case'
152169
snakeCase('snake Case With Numbers123', true); // 'snake_case_with_numbers_one_two_three'
153170
```
154171

155172
#### kebabCase
173+
156174
Converts a string to kebab-case format.
175+
157176
```js
158177
kebabCase('h3llo WoRld'); // 'h3llo-world'
159178
kebabCase('from_snake_case'); // 'from-snake-case'
160179
kebabCase('kebab Case With Numbers123', true); // 'kebab-case-with-numbers-one-two-three'
161180
```
162181

163182
#### camelCase
183+
164184
Converts a string to camelCase format.
185+
165186
```js
166187
camelCase('hello WoRld'); // 'helloWorld'
167188
camelCase('Test CaSe ExamplE'); // 'testCaseExample'
168189
camelCase('camel Case With Numbers123'); // 'camelCaseWithNumbers'
169190
```
170191

171192
#### pascalCase
193+
172194
Converts a string to PascalCase format.
195+
173196
```js
174197
pascalCase('hello WoRld'); // 'HelloWorld'
175198
pascalCase('Test CaSe ExamplE'); // 'TestCaseExample'
@@ -179,7 +202,9 @@ pascalCase('pasCal Case With Numbers123'); // 'PascalCaseWithNumbers'
179202
### Case Validation
180203

181204
#### isSnakeCase
205+
182206
Checks if a string is in snake_case format.
207+
183208
```js
184209
// Valid
185210
isSnakeCase('snake_case_example'); // true
@@ -196,7 +221,9 @@ isSnakeCase('no_CAPS'); // false
196221
```
197222

198223
#### isKebabCase
224+
199225
Checks if a string is in kebab-case format.
226+
200227
```js
201228
// Valid
202229
isKebabCase('kebab-case-example'); // true
@@ -213,7 +240,9 @@ isKebabCase('no-CAPS'); // false
213240
```
214241

215242
#### isCamelCase
243+
216244
Checks if a string is in camelCase format.
245+
217246
```js
218247
// Valid
219248
isCamelCase('camelCaseExample'); // true
@@ -226,7 +255,9 @@ isCamelCase('withThe1234'); // false
226255
```
227256

228257
#### isPascalCase
258+
229259
Checks if a string is in PascalCase format.
260+
230261
```js
231262
// Valid
232263
isPascalCase('PascalCaseExample'); // true
@@ -239,7 +270,9 @@ isPascalCase('WithThe1234'); // false
239270
```
240271

241272
### regionMatch
273+
242274
Compares two strings or regions for equality.
275+
243276
```js
244277
// Matching identical strings
245278
regionMatch('hello', 'hello'); // true
@@ -256,7 +289,9 @@ regionMatch('hello world', 'hello there', 6, 11); // false
256289
```
257290

258291
### looseRegionMatch
292+
259293
Performs a loose comparison of two strings or regions for equality.
294+
260295
```js
261296
// Loose matching identical strings
262297
looseRegionMatch('hello', 'HeLLo'); // true
@@ -268,29 +303,39 @@ looseRegionMatch(str1, str2); // true
268303
```
269304

270305
### isAlpha
306+
271307
Checks if a string contains only alphabetic characters (A-Z, a-z).
308+
272309
```js
273310
isAlpha("HelloWorld"); // true
274311
isAlpha("Hello123"); // false
275312
```
276313

277314
### isAlphaNumeric
315+
278316
Checks if a string contains only alphanumeric characters (A-Z, a-z, 0-9).
317+
279318
```js
280319
isAlphaNumeric("Hello01"); // true
281320
isAlphaNumeric("1234567890"); // false
282321
```
283322

284323
### Reverse
324+
285325
Reverses the sequence of characters in given string.
326+
286327
```js
287328
reverse('bad') // 'dab'
288329
```
289330

331+
Full documentation [here](https://full-pack.github.io/string-pack)
332+
290333
## Build
334+
291335
```
292336
npm run build
293337
```
294338

295339
## License
340+
296341
The MIT License. Full License is [here](LICENSE)

0 commit comments

Comments
 (0)