@httpie/strings
TypeScript icon, indicating that this package has built-in type declarations

1.21.0 • Public • Published


Strings

String utilities for Node.js.


Installation · Docs · Usage



Latest Version Monthly downloads

Follow @eldorplus and @httpiejs for updates!


Introduction

The @httpie/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 @httpie/strings

Docs

Find all the details for @httpie/strings in the extensive HTTPie docs.

Usage

Using @httpie/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('@httpie/strings')

const title = Str('  HTTPie is sweet!').trim().title().get()

// title: "HTTPie 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 © HTTPie


httpiejs.com  ·  GitHub @httpie  ·  Twitter @httpiejs

Package Sidebar

Install

npm i @httpie/strings

Weekly Downloads

0

Version

1.21.0

License

MIT

Unpacked Size

39.5 kB

Total Files

10

Last publish

Collaborators

  • eldorplus