@selfagencyllc/dev-tools-text

Extends @selfagencyllc/dev-tools with utilities for manipulating text.

Usage no npm install needed!

<script type="module">
  import selfagencyllcDevToolsText from 'https://cdn.skypack.dev/@selfagencyllc/dev-tools-text';
</script>

README

@selfagencyllc/dev-tools-text 0.3.1

Extends @selfagencyllc/dev-tools with utilities for manipulating text.

src/modules/_case.js

_case(str, fmt)

String case conversion

Formats:

  • camel: camelCase
  • pascal: PascalCase
  • kebab: kebab-case
  • snake: snake_case
  • sentence: Sentence case
  • title: Title Case
Parameters
Name Type Description
str string string to format  
fmt string format [camel pascal
Returns
  • string formatted string

src/modules/_hash.js

_hash(str, cipher)

Creates a hash from a string

Parameters
Name Type Description
str string string to hash  
cipher string hash cipher (defaults to SHA-512)  
Returns
  • string hex of hashed string

src/modules/_md.js

_md(str, fmt)

Converts Markdown text to HTML

Parameters
Name Type Description
str string string of Markdown text  
fmt string format of Markdown text  
Returns
  • string string of formatted text

src/modules/_punc.js

_punc(str)

Converts ASCII punctuation

Parameters
Name Type Description
str string string of unformatted text  
Returns
  • string string of formatted text

src/modules/_trunc.js

_trunc(str, len)

Converts ASCII punctuation

Parameters
Name Type Description
str string string to truncate  
len int length to truncate  
Returns
  • string string of formatted text

Documentation generated with doxdox.