html-inject-at
v1.0.2
Published
inject text in an html file at a certain element given a selector
Downloads
3
Maintainers
Readme
Install
$ npm i html-inject-at -g
Usage
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
API
Table of Contents
inject
Inject text in an HTML file at a certain element given a selector.
Parameters
options
Optionsoptions.selector
CSS selector where content will be injectedoptions.input
Input HTML file that will be transformedoptions.write
Write file in-place ** DANGEROUS! Make sure you have a backupoptions.streamIn
Input stream to use (defaults to process.stdin)options.streamOut
Output stream to use (defaults to process.stdout)
Contribute
All contributions are welcome!
License
MIT © 2021 stagas