🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

handlebars-async-helpers

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handlebars-async-helpers

Adding async function support to handlebars helpers

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

Handlebars Async Helpers

Library that adds support to asynchronous function helpers to handlebars lib.

How to install

npm install handlebars-async-helpers

How to use

const handlebars = require('handlebars'),
      asyncHelpers = require('handlebars-async-helpers')

const hb = asyncHelpers(handlebars)

hb.registerHelper('sleep', async () => new Promise((resolve) => {
    setTimeout(() => resolve('Done!'), 1000)
}))

const template = hb.compile('Mark when is completed: {{#sleep}}{{/sleep}}')
const result = await template()
console.log(result)
// 'Mark when is completed: Done!'

FAQs

Package last updated on 27 Apr 2023

Did you know?

Socket

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.

Install

Related posts