To Caption turns identifiers into readable captions: fooBar, foo_bar, foo.bar and foo-bar all become Foo Bar
View To Caption Documentation at To Caption Docs
Download at to-caption on NPM
__foo--bar__ still reads Foo BarHTTP as it is, title-case it, or space it out letter by letternull and undefined give an empty string rather than an errorThe string is split into words at dots, underscores and dashes. Each word's first character is uppercased and a space goes before every later capital, so thisIsATest becomes This Is A Test. Every other character, including spaces and slashes, is kept as it is.
A string with no lowercase letters would otherwise become one word per letter (H E L L O). The onAllUppercase option chooses what happens instead.
to-caption has been on NPM since 2017 and is MIT licensed