Skip to content

lgg-archive/node-remove-html-element

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Remove html element module

About

npm module for removing html element from .html files

Based on jsdom module

Install

npm install remove-html-element

or

npm install --save remove-html-element

or

npm install --save-dev remove-html-element

Usage

To fast test run: npm install && npm test

Selectors

For finding html elements jQuery is used, docs for selectors

Remove 1 selector in 1 file

var rem  = require('remove-html-element');
rem('file.html', '#remove-this-selector');

Remove few selectors in 1 file

var rem  = require('remove-html-element');
rem('file.html', ['#remove-this-selector', '.and-this']);

Remove same selectors in few files

var rem  = require('remove-html-element');
rem([
    ['file.html'],
    ['file2.html']
], '#remove-this-selector-in-all-files');

Remove different selectors in few files

var rem  = require('remove-html-element');
rem([
    ['file.html', ['#remove-this-selector', '.and-this']],
    ['file2.html', ['#remove-this-selector2', '.and-this2']],
]);

ToDo

  • add tests
  • save to another file
  • check if file exist
  • fix empty lines instead of removed element
  • check if selector found
  • console coloring

License

About

npm module for removing html element from .html files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published