The @js
built-in provides access to a number of JavaScript classes and utility functions that you may find useful to call directly in Origami expressions:
- Array
- Boolean
- Date
- Error
- Infinity
- Intl
- JSON
- Map
- Math
- NaN
- Number
- Object
- RegExp
- Set
- String
- Symbol
- decodeURIComponent
- decodeURI
- encodeURIComponent
- encodeURI
- false
- isFinite
- isNaN
- null
- parseFloat
- parseInt
- true
- undefined
For example, if you want to explicitly cast a value to a string in an Origami expression, you can write:
text = @js/String(value)
See also @node, which provides access to a number of Node.js modules.