html-edit
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

HTML-edit

Command line program to modify HTML files by query selector directly from the command line

npm

Usage

npx html-edit [[options]] < input.html > output.html

How to Use

Option Type Default Description
help Show help
version Show version number
attribute a string The inner text of the selected elements The attribute to modify on selected elements
query q string html Elements to select in given HTML using a DOM query selector string
replacement r string Remove the attribute (or inner text) of the selected elements Value to inject in the selected elements
evaluate e boolean false Whether the replacement should be treated as evaluated JS code

Examples

Adds the dark attribute to the html element npx html-edit -a dark < input.html > output.html

Adds the current unixtime to the date-time attribute for the time elements npx html-edit -er "+new Date" -a date-time -q time < input.html > output.html

Readme

Keywords

none

Package Sidebar

Install

npm i html-edit

Weekly Downloads

1

Version

0.0.1

License

GPL-3.0

Unpacked Size

43.9 kB

Total Files

12

Last publish

Collaborators

  • mothepro