
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Here goes yet another string manipulation package.
Well, there are many other string npm packages, like string and others. stri contains functionality that I need, but other packages miss. Only a handful of functions, but useful ones.
npm i stri -S
To have all functions at your disposal, import it and then do this in your main:
Stri.includeMe()
After that all methods will be available as String members.
▸ Static between(s, borderA, borderB, aIsFirst, bIsFirst): stringOrUndefined
returns string between borders
| Name | Type | Description |
|---|---|---|
s | stringOrUndefined | - |
borderA | stringOrUndefined | left border |
borderB | stringOrUndefined | right border |
aIsFirst | boolean | true if borderA is first, false if is last |
bIsFirst | boolean | true if borderB is first, false if is last |
▸ Static cutFirst(s, splitter): stringOrUndefined
fast way to cut away a first part split by smth, for instance
"lalala/hahaha/bebebe".cutFirst('/') will return "hahaha/bebebe"
| Name | Type |
|---|---|
s | stringOrUndefined |
splitter | stringOrUndefined |
▸ Static cutLast(s, splitter): stringOrUndefined
fast way to cut away a last part split by smth, for instance
"lalala/hahaha/bebebe".cutLast('/') will return "lalala/hahaha"
| Name | Type |
|---|---|
s | stringOrUndefined |
splitter | stringOrUndefined |
▸ Static getBetween(s, borderA, borderB): stringOrUndefined
returns string between borderA and B. Gets between the first A and the LAST B
| Name | Type |
|---|---|
s | stringOrUndefined |
borderA | stringOrUndefined |
borderB | stringOrUndefined |
▸ Static getBetweenClose(s, borderA, borderB): stringOrUndefined
returns string between borderA and B. Gets between the FIRST A and the FIRST B
| Name | Type |
|---|---|
s | stringOrUndefined |
borderA | stringOrUndefined |
borderB | stringOrUndefined |
▸ Static getFirst(s, splitter): stringOrUndefined
fast way get the first part split by smth, for instance
"lalala/hahaha/bebebe".getFirst('/') will return "lalala"
| Name | Type |
|---|---|
s | stringOrUndefined |
splitter | stringOrUndefined |
▸ Static getLast(s, splitter): stringOrUndefined
fast way to get the last part split by smth, for instance
"lalala/hahaha/bebebe".getLast('/') will return "bebebe"
| Name | Type |
|---|---|
s | stringOrUndefined |
splitter | stringOrUndefined |
▸ Static has(s, what): boolean
does this string contain what?
| Name | Type |
|---|---|
s | stringOrUndefined |
what | string |
boolean
▸ Static includeMe(): string
needs to be called once in the very beginning of your app
string
▸ Static oust(s, what): boolean
Removes all whats in the string
In fact, same as str.split(what).join('')
| Name | Type | Description |
|---|---|---|
s | stringOrUndefined | - |
what | stringOrUndefined | what to remove |
boolean
▸ Static swap(s, from, to): undefined | string
Replaces from with to
| Name | Type | Description |
|---|---|---|
s | stringOrUndefined | - |
from | stringOrUndefined | what to replace |
to | stringOrUndefined | to what to replace |
undefined | string
FAQs
Yet another helper tool for string manipulation.
We found that stri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.