Socket
Socket
Sign inDemoInstall

@umpacken/handlebars-async-helpers

Package Overview
Dependencies
6
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @umpacken/handlebars-async-helpers

Adding async function support to handlebars helpers


Version published
Maintainers
1
Created

Readme

Source

IMPORTANT: This is the repack of the original version with updated dependencies

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

Last updated on 18 Dec 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc