https://github.com/supercharge/strings
String utilities for Node.js
https://github.com/supercharge/strings
chainable-methods hacktoberfest hacktoberfest2021 nodejs string supercharge utilities
Last synced: about 2 months ago
JSON representation
String utilities for Node.js
- Host: GitHub
- URL: https://github.com/supercharge/strings
- Owner: supercharge
- License: mit
- Created: 2019-12-06T15:05:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T05:07:14.000Z (over 2 years ago)
- Last Synced: 2025-02-14T15:47:43.147Z (2 months ago)
- Topics: chainable-methods, hacktoberfest, hacktoberfest2021, nodejs, string, supercharge, utilities
- Language: JavaScript
- Homepage: https://superchargejs.com/docs/strings
- Size: 302 KB
- Stars: 44
- Watchers: 4
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Strings
String utilities for Node.js.
Installation ·
Docs ·
Usage
Follow @marcuspoehls and @superchargejs for updates!
---
## Introduction
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.## Installation
```
npm i @supercharge/strings
```## Docs
Find all the [details for `@supercharge/strings` in the extensive Supercharge docs](https://superchargejs.com/docs/strings).## Usage
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:
```js
import { Str } from '@supercharge/strings'
// or
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.
## Contributing
Do you miss a string function? We very much appreciate your contribution! Please send in a pull request 😊1. Create a fork
2. Create your feature branch: `git checkout -b my-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request 🚀## License
MIT © [Supercharge](https://superchargejs.com)---
> [superchargejs.com](https://superchargejs.com) ·
> GitHub [@supercharge](https://github.com/supercharge) ·
> Twitter [@superchargejs](https://twitter.com/superchargejs)