posthtml-remove-tags
A posthtml plugin for removing tags
Last updated 5 years ago by scrum .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install posthtml-remove-tags 
SYNC missed versions from official npm registry.

remove tags

A posthtml A posthtml plugin for removing tags

Travis Build StatusAppVeyor Build Statusnodenpm versionDependency StatusXO code styleCoveralls status

npm downloadsnpmPackage Quality

Why?

Essential for removing unwanted or tags do not pass validation

Install

npm i -S posthtml posthtml-remove-tags

Note: This project is compatible with node v4+

Usage

import {readFileSync, writeFileSync} from 'fs';
import posthtml from 'posthtml';
import removeTags from 'posthtml-remove-tags';

const html = readFileSync('input.html', 'utf8');

posthtml()
    .use(removeTags({tags: ['style', 'script']}))
    .process(html)
    .then(result => {
        writeFileSync('output.html', result.html);
    });

Returns the html without the tags listed in option

Example

input.html

<!DOCTYPE html>
<head><style></style></head>

output.html

<!DOCTYPE html>
<head></head>

Options

tags

Type: Array
Default: []
Description: The list of tags to be deleted

LICENSE

MIT License (MIT)

Copyright (c) Ivan Demidov scrum@list.ru

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 0.1.0                                ...           latest (5 years ago)

2 Versions

  • 0.1.0                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (2)
Downloads
Total 195
Today 0
This Week 2
This Month 3
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (28)

Copyright 2014 - 2021 © npmmirror.com |