ChildNode ponyfill
ChildNode
ponyfill.
Install
npm i @yuheiy/childnode-ponyfill
Usage
import {replaceWith} from '@yuheiy/childnode-ponyfill'
const oldElement = document.getElementById('#old')
const newElement = document.createElement('div')
replaceWith(oldElement, newElement)
API
before(childNode, ...nodes)
Same API with ChildNode.before()
after(childNode, ...nodes)
Same API with ChildNode.after()
replaceWith(childNode, ...nodes)
Same API with ChildNode.replaceWith()
remove(childNode)
Same API with ChildNode.remove()
License
MIT