Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

voca
javascript
communitycreator

What is the Voca.js library?

Programming Bytes

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

Voca is a popular JavaScript library that contains multiple utility and helper functions for string-related operations. Voca.js can be used directly inside a browser and also with Node.js.

Note: To learn more about Voca.js, click here.

Voca.js includes multiple helper functions for the following:

  • change case
  • trim
  • pad
  • slugify
  • latinise
  • sprintf'y
  • truncate
  • escape 

Note: Voca.js is licensed under the MIT license. You can find the repo of Voca.js here.

Example

The code below demonstrates how to use Voca.js:

Console
Use Voca.js

Explanation

  • Line 9: We include the Voca.js library file from the CDN server. The variable v accesses the library function.
  • Line 11: We create a string, str, with the value, Educative Corporation.
  • Line 13: We use the upperCase method of the Voca.js library to convert the str to uppercase.
  • Line 14: We use the camelCase method of the Voca.js library to convert the str to camelcase.
  • Line 15: We use the kebabCase method of the Voca.js library to convert the str to kebab-case.
  • Line 18: We use the reverse method to reverse the str.
  • Line 21: We assign an str variable with a string with HTML tags.
  • Line 23: We use the escapeHtml method to escape the HTML tags in the string.

Note: Check all the available functions in Voca.js here.

RELATED TAGS

voca
javascript
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring