Skip to content

iamallyniam/noclass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

noclass

Remove class names from strings

Install

npm install noclass --save-dev

Methods

classFromString

Removes all classes from the string, unless an array is passed through to protect select classes.

var noclass = require('noclass'),
saveclasses = ['safe'];
var cleanString = noclass.classFromFile('<div class="notSafe"><div class="Safe"><div class="safe"></div></div></div>', saveclasses);

In this case cleanString would return <div ><div ><div class="safe"></div></div></div>. This is because the classes will only match case sensitive.

classFromFile

Remove all classes from a file. The file will be read in sync.

var noclass = require('noclass'),
var cleanString = noclass.classFromFile('/path/to/file.html', []);

Releases

No releases published

Packages

No packages published