Introduction
Instead of reinventing the wheel, Compozy provides direct access to well-established JavaScript utility libraries within your template expressions:- Lodash - For general utility functions (
_) - Voca - For string manipulation (
v) - Day.js - For date operations (
dayjs) - Numeral.js - For number formatting (
numeral)
$ namespace (e.g., $.math, $.decimal). Check out Custom Dependencies to learn more.
Built-in Libraries
Lodash Functions
Available through the_ global variable.
Voca Functions
Available through thev global variable.
Day.js Functions
Available through thedayjs global variable.
Numeral.js Functions
Available through thenumeral global variable.
Best Practices
Library Documentation
Each library provides extensive documentation for their functions:- Lodash Documentation - Complete reference of all available Lodash functions
- Voca Documentation - Comprehensive guide to string manipulation functions
- Day.js Documentation - Date manipulation and formatting guide
- Numeral.js Documentation - Number formatting guide
Function Categories
For convenience, we’ve organized common operations into categories:- String Functions - String manipulation examples using Voca
- Array Functions - Array operations using Lodash
- Object Functions - Object manipulation with Lodash
- Date Functions - Date operations using Day.js