![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@checkly/handlebars
Advanced tools
This library is a very simple wrapper around the templating library Handlebars that bundles additional helpers. It can be used as a drop-in replacement. At Checkly, we use Handlebars to provide a powerful flexibility in some of our features like creating custom bodies for alerting webhooks.
Checkly is an active reliability platform that brings together the best of end-to-end testing and active monitoring to serve modern, cross-functional DevOps teams. With a focus on JavaScript-based Open Source tech stacks, Checkly is easy to get started with and seamlessly integrates into your development workflow.
Install via NPM:
$ npm install @checkly/handlebars --save # or yarn add @checkly/handlebars
You can use it as a drop-in replacement for Handlebars:
// replaced the following
const Handlebars = require('handlebars')
// with
const Handlebars = require('@checkly/handlebars')
Built-in helpers provided by the vanilla Handlebars package can still be used. If you are using this library for your own project, you can couple it with other libraries that adds functionality such as handlebars-extra
.
Produces a random number between 0 and 1000.
Example
Your lucky number is {{$RANDOM_NUMBER}}
<!-- results in: '345' -->
Provides a UUID string from cryptographically-strong random values, compliant with RFC4122's Version 4.
SessionId: {{$UUID}}
<!-- results in: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' -->
Splits a given string and return an element from the split array.
Params
string
{String}separator
{String}index
{Number}: defaults to -1returns
{Array|String}Example
{{split "somekey:somevalue" ":" 1}}
<!-- results in: 'somevalue' -->
{{split "a long sentence" " " -1}}
<!-- results in: ['a', 'long', 'sentence'] -->
Allows moment to be used as a helper. helper-date is used behind the scenes for this helper.
{{moment "5 years ago" "YYYY"}}
//=> 2015
Helper that renders the block if both of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression.
Params
a
{any}b
{any}options
{Object}: Handlebars provided options objectreturns
{String}Example
<!-- {great: true, magnificent: true} -->
{{#and great magnificent}}A{{else}}B{{/and}}
<!-- results in: 'A' -->
Render a block when a comparison of the first and third arguments returns true. The second argument is the arithemetic operator to use. You may also optionally specify an inverse block to render when falsy.
Params
a
{}operator
{}: The operator to use. Operators must be enclosed in quotes: ">"
, "="
, "<="
, and so on.b
{}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or if specified the inverse block is rendered if falsey.Block helper that renders the block if collection
has the given value
, using strict equality (===
) for comparison, otherwise the inverse block is rendered (if specified). If a startIndex
is specified and is negative, it is used as the offset from the end of the collection.
Params
collection
{Array|Object|String}: The collection to iterate over.value
{any}: The value to check for.[startIndex=0]
{Number}: Optionally define the starting index.options
{Object}: Handlebars provided options object.Example
<!-- array = ['a', 'b', 'c'] -->
{{#contains array "d"}}
This will not be rendered.
{{else}}
This will be rendered.
{{/contains}}
Returns the first value that is not undefined, otherwise the "default" value is returned.
Params
value
{any}defaultValue
{any}returns
{String}Block helper that renders a block if a
is equal to b
.
If an inverse block is specified it will be rendered when falsy.
You may optionally use the compare=""
hash argument for the
second value.
Params
a
{String}b
{String}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that renders a block if a
is greater than b
.
If an inverse block is specified it will be rendered when falsy.
You may optionally use the compare=""
hash argument for the
second value.
Params
a
{String}b
{String}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that renders a block if a
is greater than or equal to b
.
If an inverse block is specified it will be rendered when falsy.
You may optionally use the compare=""
hash argument for the
second value.
Params
a
{String}b
{String}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that renders a block if value
has pattern
.
If an inverse block is specified it will be rendered when falsy.
Params
val
{any}: The value to check.pattern
{any}: The pattern to check for.options
{Object}: Handlebars provided options objectreturns
{String}Returns true if the given value
is falsey. Uses the falsey
library for comparisons. Please see that library for more information
or to report bugs with this helper.
Params
val
{any}options
{Options}returns
{Boolean}Returns true if the given value
is truthy. Uses the falsey
library for comparisons. Please see that library for more information
or to report bugs with this helper.
Params
val
{any}options
{Options}returns
{Boolean}Return true if the given value is an even number.
Params
number
{Number}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Example
{{#ifEven value}}
render A
{{else}}
render B
{{/ifEven}}
Conditionally renders a block if the remainder is zero when
a
operand is divided by b
. If an inverse block is specified
it will be rendered when the remainder is not zero.
Params
options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that renders a block if value
is an odd number. If an inverse block is specified it will be rendered when falsy.
Params
value
{Object}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Example
{{#ifOdd value}}
render A
{{else}}
render B
{{/ifOdd}}
Block helper that renders a block if a
is equal to b
.
If an inverse block is specified it will be rendered when falsy.
Similar to eq but does not do strict equality.
Params
a
{any}b
{any}options
{Object}: Handlebars provided options objectreturns
{String}Block helper that renders a block if a
is not equal to b
.
If an inverse block is specified it will be rendered when falsy.
Similar to unlessEq but does not use strict equality for
comparisons.
Params
a
{String}b
{String}options
{Object}: Handlebars provided options objectreturns
{String}Block helper that renders a block if a
is less than b
.
If an inverse block is specified it will be rendered when falsy.
You may optionally use the compare=""
hash argument for the
second value.
Params
context
{Object}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that renders a block if a
is less than or equal to b
.
If an inverse block is specified it will be rendered when falsy.
You may optionally use the compare=""
hash argument for the
second value.
Params
a
{Sring}b
{Sring}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that renders a block if neither of the given values are truthy. If an inverse block is specified it will be rendered when falsy.
Params
a
{any}b
{any}options
{}: Handlebars options objectreturns
{String}: Block, or inverse block if specified and falsey.Returns true if val
is falsey. Works as a block or inline helper.
Params
val
{String}options
{Object}: Handlebars provided options objectreturns
{String}Block helper that renders a block if any of the given values is truthy. If an inverse block is specified it will be rendered when falsy.
Params
arguments
{...any}: Variable number of argumentsoptions
{Object}: Handlebars options objectreturns
{String}: Block, or inverse block if specified and falsey.Example
{{#or a b c}}
If any value is true this will be rendered.
{{/or}}
Block helper that always renders the inverse block unless a
is
is equal to b
.
Params
a
{String}b
{String}options
{Object}: Handlebars provided options objectreturns
{String}: Inverse block by default, or block if falsey.Block helper that always renders the inverse block unless a
is
is greater than b
.
Params
a
{Object}: The default valueb
{Object}: The value to compareoptions
{Object}: Handlebars provided options objectreturns
{String}: Inverse block by default, or block if falsey.Block helper that always renders the inverse block unless a
is
is less than b
.
Params
a
{Object}: The default valueb
{Object}: The value to compareoptions
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that always renders the inverse block unless a
is
is greater than or equal to b
.
Params
a
{any}b
{any}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.Block helper that always renders the inverse block unless a
is
is less than or equal to b
.
Params
a
{any}b
{any}options
{Object}: Handlebars provided options objectreturns
{String}: Block, or inverse block if specified and falsey.FAQs
A Handlebars wrapper that adds a few helpers
The npm package @checkly/handlebars receives a total of 0 weekly downloads. As such, @checkly/handlebars popularity was classified as not popular.
We found that @checkly/handlebars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.