0.0.1 • Published 1 year ago

html-edit v0.0.1

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
1 year ago

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

OptionTypeDefaultDescription
helpShow help
versionShow version number
attribute astringThe inner text of the selected elementsThe attribute to modify on selected elements
query qstringhtmlElements to select in given HTML using a DOM query selector string
replacement rstringRemove the attribute (or inner text) of the selected elementsValue to inject in the selected elements
evaluate ebooleanfalseWhether 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

0.0.1

1 year ago