
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@supercharge/strings
Advanced tools
String utilities for Node.js.
Installation · Docs · Usage
Follow @marcuspoehls and @superchargejs for updates!
The @supercharge/strings
package provides chainable string utilities for Node.js and JavaScript. It’s a wrapper around JavaScript’s global String
class providing a handful of useful methods, like .title()
, .strip()
, .camel()
, and so on.
npm i @supercharge/strings
Find all the details for @supercharge/strings
in the extensive Supercharge docs.
Using @supercharge/strings
is pretty straightforward. Pass a string to the imported Function and chain your desired methods to transform to string value to your needs.
For example, you may want to trim a string and then title-case it:
const Str = require('@supercharge/strings')
const title = Str(' Supercharge is sweet!').trim().title().get()
// title: "Supercharge Is Sweet!"
For every method in the chain that would return a string, the package returns an instance of iteself. This way, you can chain further methods. Call .get()
to retrieve the actual JavaScript string.
Do you miss a string function? We very much appreciate your contribution! Please send in a pull request 😊
git checkout -b my-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © Supercharge
superchargejs.com · GitHub @supercharge · Twitter @superchargejs
2.0.0 - 2022-12-28
words
: keeps words consisting of alpha-numeric characters. Previously, also symbols like comma or exclamation mark were kept as wordsStr
used via
import { Str } from '@supercharge/strings'
const { Str } = require('@supercharge/strings')
FAQs
String utilities for Node.js and JavaScript
We found that @supercharge/strings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.