
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
html-tag-helpers
Advanced tools
Easily generate helpers for creating HTML tags. Works great as handlebars helpers or vanilla javascript utils.

Easily generate helpers for creating HTML tags. Works great as handlebars helpers or vanilla javascript utils.
npm i html-tag-helpers --save-dev
Create a new instance of Tags:
var Tags = require('html-tag-helpers');
var html = new Tags();
Generate a function to create any HTML tag:
var apple = html.addTag('apple');
// pass text as the first parameter, and an object of
// attributes as the second param.
console.log(apple('a', {href: 'b'})
//=> '<apple href="b">a</apple>'
// or pass text as a property
console.log(apple({href: 'b', text: 'a'})
//=> '<apple href="b">a</apple>'
Pass default attributes as a second paramter:
var css = html.addTag('link', {rel: 'stylesheet'});
console.log(css({href: 'styles.css'}));
//=> <link href="styles.css" rel="stylesheet">
To create a handlebars helper:
Handlebars.registerHelper('orange', tag.addTag('orange'));
var tmpl = Handlebars.compile('{{{orange "This is text" href=link}}}');
console.log(tmpl({link: 'about/us.html'}));
//=> '<orange href="about/us.html">This is text</orange>'
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on August 21, 2014.
FAQs
Easily generate helpers for creating HTML tags. Works great as handlebars helpers or vanilla javascript utils.
We found that html-tag-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.