Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

posthtml-prefix-class

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthtml-prefix-class

PostHTML plugin to prefix class names

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

posthtml-prefix-class

Build Status

PostHTML plugin to prefix class names.

Installation

npm install --save-dev posthtml-prefix-class

Usage

var posthtml = require('posthtml');
var posthtmlPrefixClass = require('posthtml-prefix-class');

posthtml()
    .use(posthtmlPrefixClass({
        prefix: 'prefix-',
        ignore: ['selector-2']
    }))
    .process(
        '<div class="selector-1"><div class="selector-2"></div></div>'
    )
    .then(function (output) {
        console.log(output.html);
        // <div class="prefix-selector-1"><div class="selector-2"></div></div>
    });

Options

prefix

Type: String
Default: ''

The string used to prefix class names.

ignore

Type: Array|String
Default: []

A class name, or an array of class names, to be excluded from prefixing. Accepts any glob expression supported by minimatch.

var posthtml = require('posthtml');
var posthtmlPrefixClass = require('posthtml-prefix-class');

posthtml()
    .use(posthtmlPrefixClass({
        prefix: 'prefix-',
        ignore: ['selector-*']
    }))
    .process(
        '<div class="selector-1"><div class="selector-2"></div></div>'
    )
    .then(function (output) {
        console.log(output.html);
        // <div class="selector-1"><div class="selector-2"></div></div>
    });

Testing

npm test

Keywords

FAQs

Package last updated on 22 Sep 2016

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