html-amend
Amends HTML by inserting attributes into elements, or elements into the DOM.

Information
No HTML parsing! This is good because it is quick and easy... but also limited. Currently, only the first occurrence of an element is supported. It should be fairly trivial to add advanced locators.
| Package | html-amend |
| Description | Amends HTML by inserting attributes into elements, or elements into the DOM. |
| Node Version | >= 6 |
Usage
Install
$ npm install html-amend --save-dev
API
function replaceWith(input, regex, content);
function afterElementOpen(input, element, content);
function beforeElementClose(input, element, content)
function insertComment(input, element, comment)
function insertAttribute(input, element, attributeName, attributeValue);
Building
npm install
npm run build
Running Tests
Tests expect to be run against an distribution, so be sure to build before running tests.
npm run test
To re-run tests during development:
npm run test:watch
Deploying
This is a basic script which can be used to build and deploy (to NPM) the project.
export VERSION=<NEXT VERSION>
git checkout -b release/$VERSION
npm version --no-git-tag-version patch
npm run build
npm run test
git add package*
git commit -m 'Version bump'
npx auto-changelog -p
git add CHANGELOG.md
git commit -m 'Updated changelog'
git checkout master
git merge --no-ff release/$VERSION
git tag -a -m 'Tagged for release' $VERSION
git branch -d release/$VERSION
git checkout develop
git merge --no-ff master
git push --all && git push --tags
LICENSE
MIT License