Socket
Socket
Sign inDemoInstall

get-tag

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-tag

Create HTML tag strings on the fly.


Version published
Weekly downloads
441
increased by6.01%
Maintainers
1
Weekly downloads
 
Created
Source

get-tag

Create HTML tag strings on the fly.

Installation

Install the package from npm:

npm install get-tag

Usage

const getTag = require('get-tag');

console.log(getTag('title', 'Some Title'));
// <title>Some Title</title>

console.log(getTag('a', 'Some Link', {href: 'foo.com'}));
// <a href="foo.com">Some link</a>

console.log(getTag('meta', null, {name: 'author', content: 'foo'}));
// <meta name="author" content="foo">

If the provided HTML tag name is included in the void-elements list, then selfClosing will be set to true.

Keywords

FAQs

Package last updated on 22 Oct 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc