1.0.2 • Published 4 years ago
html-inject-at v1.0.2
Install
$ npm i html-inject-at -gUsage
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.htmlAPI
Table of Contents
inject
Inject text in an HTML file at a certain element given a selector.
Parameters
optionsOptionsoptions.selectorCSS selector where content will be injectedoptions.inputInput HTML file that will be transformedoptions.writeWrite file in-place ** DANGEROUS! Make sure you have a backupoptions.streamInInput stream to use (defaults to process.stdin)options.streamOutOutput stream to use (defaults to process.stdout)
Contribute
All contributions are welcome!
License
MIT © 2021 stagas