JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 356732
  • Score
    100M100P100Q161858F

Generate HTML tags from JSON.

Package Exports

  • html-tag

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (html-tag) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

html-tag NPM version

Generate HTML tags from JSON.

This is based on the html_tag utility in Hexo.

Install

Install with npm:

npm i html-tag --save-dev

Usage

tag ( name, attrs, text )

Create a snippet of HTML.

Examples:

tag('a', {href: 'http://www.google.com'}, 'Google');
tag('img', {src: 'foo.jpg'});

yields:

<a href="http://www.google.com">Google</a>
<img src="foo.jpg">
  • tag {String}: The tag to create.
  • attrs {Object}: Optional attributes
  • text {String}: Optional text
  • return {String} HTML

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Copyright (c) 2012 Tommy Chen

Released under the MIT license


This file was generated by verb-cli on August 21, 2014.