🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

selector2tag

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selector2tag

Utility function to build individual HTML tags from CSS selectors.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

selector2tag

Utility function to build individual HTML tags from CSS selectors. Uses Slick's parser for most of the hard work. I should rework it to build multiple tags.

Example

	var sel2tag = require('selector2tag');
	var wrap = sel2tag('main#content.wrapper.foo[role="main"][bar]');
	
	var result = wrap.openingTag + 'Hello World' + wrap.closingTag;

Result:

<main id="content" class="wrapper foo" role="main" bar>Hello World</main>

The tag name defaults to div.

Keywords

utility

FAQs

Package last updated on 22 Aug 2014

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