Skip to content

Commit 15907a6

Browse files
committed
Add string processing commands
1 parent d6e3f06 commit 15907a6

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed

bin/commands.json

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"path": "./lib/node_modules/@stdlib/_tools/bundle/pkg-list/bin/cli",
1818
"group": "Tools"
1919
},
20+
{
21+
"cmd": "capitalize",
22+
"desc": "Capitalize the first character in a string.",
23+
"path": "./lib/node_modules/@stdlib/string/capitalize/bin/cli",
24+
"group": "Utils"
25+
},
2026
{
2127
"cmd": "configdir",
2228
"desc": "Configuration directory path.",
@@ -35,12 +41,42 @@
3541
"path": "./lib/node_modules/@stdlib/datasets/bin/cli",
3642
"group": ""
3743
},
44+
{
45+
"cmd": "ends-with",
46+
"desc": "Test if a string ends with another string.",
47+
"path": "./lib/node_modules/@stdlib/string/ends-with/bin/cli",
48+
"group": "Utils"
49+
},
50+
{
51+
"cmd": "from-code-point",
52+
"desc": "Create a string from a sequence of code points.",
53+
"path": "./lib/node_modules/@stdlib/string/from-code-point/bin/cli",
54+
"group": "Utils"
55+
},
3856
{
3957
"cmd": "homedir",
4058
"desc": "Home directory path.",
4159
"path": "./lib/node_modules/@stdlib/os/homedir/bin/cli",
4260
"group": "System"
4361
},
62+
{
63+
"cmd": "left-pad",
64+
"desc": "Left pad a string.",
65+
"path": "./lib/node_modules/@stdlib/string/left-pad/bin/cli",
66+
"group": "Utils"
67+
},
68+
{
69+
"cmd": "left-trim",
70+
"desc": "Left trim a string.",
71+
"path": "./lib/node_modules/@stdlib/string/left-trim/bin/cli",
72+
"group": "Utils"
73+
},
74+
{
75+
"cmd": "lowercase",
76+
"desc": "Lowercase a string.",
77+
"path": "./lib/node_modules/@stdlib/string/lowercase/bin/cli",
78+
"group": "Utils"
79+
},
4480
{
4581
"cmd": "ls",
4682
"desc": "List stdlib package names.",
@@ -71,34 +107,136 @@
71107
"path": "./lib/node_modules/@stdlib/os/num-cpus/bin/cli",
72108
"group": "System"
73109
},
110+
{
111+
"cmd": "pad",
112+
"desc": "Pad a string.",
113+
"path": "./lib/node_modules/@stdlib/string/pad/bin/cli",
114+
"group": "Utils"
115+
},
116+
{
117+
"cmd": "percent-encode",
118+
"desc": "Percent-encode a UTF-16 encoded string.",
119+
"path": "./lib/node_modules/@stdlib/string/percent-encode/bin/cli",
120+
"group": "Utils"
121+
},
74122
{
75123
"cmd": "platform",
76124
"desc": "Platform.",
77125
"path": "./lib/node_modules/@stdlib/os/platform/bin/cli",
78126
"group": "System"
79127
},
128+
{
129+
"cmd": "remove-first",
130+
"desc": "Remove the first character in a string.",
131+
"path": "./lib/node_modules/@stdlib/string/remove-first/bin/cli",
132+
"group": "Utils"
133+
},
134+
{
135+
"cmd": "remove-last",
136+
"desc": "Remove the last character in a string.",
137+
"path": "./lib/node_modules/@stdlib/string/remove-last/bin/cli",
138+
"group": "Utils"
139+
},
140+
{
141+
"cmd": "remove-punctuation",
142+
"desc": "Remove punctuation characters from a string.",
143+
"path": "./lib/node_modules/@stdlib/string/remove-punctuation/bin/cli",
144+
"group": "Utils"
145+
},
146+
{
147+
"cmd": "remove-utf8-bom",
148+
"desc": "Remove a UTF-8 byte order mark (BOM).",
149+
"path": "./lib/node_modules/@stdlib/string/remove-first/bin/cli",
150+
"group": "Utils"
151+
},
152+
{
153+
"cmd": "remove-words",
154+
"desc": "Remove a list of words from a string.",
155+
"path": "./lib/node_modules/@stdlib/string/remove-words/bin/cli",
156+
"group": "Utils"
157+
},
158+
{
159+
"cmd": "repeat",
160+
"desc": "Repeat a string.",
161+
"path": "./lib/node_modules/@stdlib/string/repeat/bin/cli",
162+
"group": "Utils"
163+
},
80164
{
81165
"cmd": "repl",
82166
"desc": "Start a REPL.",
83167
"path": "./lib/node_modules/@stdlib/repl/bin/cli",
84168
"group": ""
85169
},
170+
{
171+
"cmd": "replace",
172+
"desc": "Replace search occurrences in a string.",
173+
"path": "./lib/node_modules/@stdlib/string/replace/bin/cli",
174+
"group": "Utils"
175+
},
176+
{
177+
"cmd": "reverse",
178+
"desc": "Reverse a string.",
179+
"path": "./lib/node_modules/@stdlib/string/reverse/bin/cli",
180+
"group": "Utils"
181+
},
182+
{
183+
"cmd": "right-pad",
184+
"desc": "Right pad a string.",
185+
"path": "./lib/node_modules/@stdlib/string/right-pad/bin/cli",
186+
"group": "Utils"
187+
},
188+
{
189+
"cmd": "right-trim",
190+
"desc": "Right trim a string.",
191+
"path": "./lib/node_modules/@stdlib/string/right-trim/bin/cli",
192+
"group": "Utils"
193+
},
86194
{
87195
"cmd": "sparkline",
88196
"desc": "Plot a sparkline.",
89197
"path": "./lib/node_modules/@stdlib/plot/sparklines/unicode/bin/cli",
90198
"group": "Plot"
91199
},
200+
{
201+
"cmd": "startcase",
202+
"desc": "Capitalize each word in a string.",
203+
"path": "./lib/node_modules/@stdlib/string/startcase/bin/cli",
204+
"group": "Utils"
205+
},
206+
{
207+
"cmd": "starts-with",
208+
"desc": "Test if a string starts with another string.",
209+
"path": "./lib/node_modules/@stdlib/string/starts-with/bin/cli",
210+
"group": "Utils"
211+
},
92212
{
93213
"cmd": "tmpdir",
94214
"desc": "Directory path for storing temporary files.",
95215
"path": "./lib/node_modules/@stdlib/os/tmpdir/bin/cli",
96216
"group": "System"
97217
},
218+
{
219+
"cmd": "trim",
220+
"desc": "Trim a string.",
221+
"path": "./lib/node_modules/@stdlib/string/trim/bin/cli",
222+
"group": "Utils"
223+
},
98224
{
99225
"cmd": "umask",
100226
"desc": "Process mask.",
101227
"path": "./lib/node_modules/@stdlib/process/umask/bin/cli",
102228
"group": "System"
229+
},
230+
{
231+
"cmd": "uncapitalize",
232+
"desc": "Uncapitalize a string.",
233+
"path": "./lib/node_modules/@stdlib/string/uncapitalize/bin/cli",
234+
"group": "Utils"
235+
},
236+
{
237+
"cmd": "uppercase",
238+
"desc": "Uppercase a string.",
239+
"path": "./lib/node_modules/@stdlib/string/uppercase/bin/cli",
240+
"group": "Utils"
103241
}
104242
]

bin/usage.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,41 @@ Commands:
1111
help [command] Print a help message.
1212
arch Operating system CPU architecture.
1313
bundle-pkg-list Bundle a list of stdlib packages.
14+
capitalize Capitalize the first character in a string.
1415
configdir Configuration directory path.
1516
cwd Current working directory.
1617
datasets Retrieve a dataset.
18+
ends-with Test if a string ends with another string.
19+
from-code-point Create a string from a sequence of code points.
1720
homedir Home directory path.
21+
left-pad Left pad a string.
22+
left-trim Left trim a string.
23+
lowercase Lowercase a string.
1824
ls List stdlib package names.
1925
ls-tree Show stdlib package tree.
2026
node-version Node.js version.
2127
ns Print stdlib namespace.
2228
num-cpus Number of CPUs.
29+
pad Pad a string.
30+
percent-encode Percent-encode a UTF-16 encoded string.
2331
platform Platform.
32+
remove-first Remove the first character in a string.
33+
remove-last Remove the last character in a string.
34+
remove-punctuation Remove punctuation characters from a string.
35+
remove-utf8-bom Remove a UTF-8 byte order mark (BOM).
36+
remove-words Remove a list of words from a string.
37+
repeat Repeat a string.
2438
repl Start a REPL.
39+
replace Replace search occurrences in a string.
40+
reverse Reverse a string.
41+
right-pad Right pad a string.
42+
right-trim Right trim a string.
2543
sparkline Plot a sparkline.
44+
startcase Capitalize each word in a string.
45+
starts-with Test if a string starts with another string.
2646
tmpdir Directory path for storing temporary files.
47+
trim Trim a string.
2748
umask Process mask.
49+
uncapitalize Uncapitalize a string.
50+
uppercase Uppercase a string.
2851

0 commit comments

Comments
 (0)