inject text in an html file at a certain element given a selector
🔧 Install · 🧩 Example · 📜 API docs · 🔥 Releases · 💪🏼 Contribute · 🖐️ Help
$ npm i html-inject-at -g
Usage: html-inject-at [options] <selector>
<selector> CSS selector where content will be injected
-i, --input=... Input HTML file that will be transformed
-w, --write Write file in-place ** DANGEROUS! Make sure you have a backup
Examples:
# Replace body contents with "foo" from stdin, write to stdout
echo foo | html-inject-at body -i index.html
# Replace contents in element with id `toc` and write file in-place
toc index.html | html-inject-at "#toc" -w -i index.html
Inject text in an HTML file at a certain element given a selector.
-
options
Options-
options.selector
CSS selector where content will be injected -
options.input
Input HTML file that will be transformed -
options.write
Write file in-place ** DANGEROUS! Make sure you have a backup -
options.streamIn
Input stream to use (defaults to process.stdin) -
options.streamOut
Output stream to use (defaults to process.stdout)
-
All contributions are welcome!
MIT © 2021 stagas