@cjser/humanize-string
v3.1.0-cjser.2
Published
Convert a camelized/dasherized/underscored string into a humanized one: `fooBar-Baz_Faz` → `Foo bar baz faz`
Maintainers
Readme
humanize-string
Convert a camelized/dasherized/underscored string into a humanized one Example:
fooBar-Baz_Faz→Foo bar baz faz
Install
npm install humanize-stringUsage
import humanizeString from 'humanize-string';
humanizeString('fooBar');
//=> 'Foo bar'
humanizeString('foo-bar');
//=> 'Foo bar'
humanizeString('foo_bar');
//=> 'Foo bar'API
humanizeString(input, options?)
input
Type: string
The string to humanize.
options
Type: object
preserveCase
Type: boolean
Default: false
Preserve the original case instead of lowercasing.
import humanizeString from 'humanize-string';
humanizeString('The-NetApp-Guide-to-Kubernetes');
//=> 'The net app guide to kubernetes'
humanizeString('The-NetApp-Guide-to-Kubernetes', {preserveCase: true});
//=> 'The NetApp Guide to Kubernetes'Related
- camelcase - Convert a dash/dot/underscore/space separated string to camelcase
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/humanize-string
