insert2
Insert string into HTML.
Install
$ npm install --save insert2
Usage
const html = `<html> <head> <title>hi</title> </head> <body> </body></html> ` // returned<html> <head> <title>hi</title> <link rel="stylesheet" href="style.css" /> </head> <body> </body></html>
API
insert2(html, options)
html
Type: string
Default: ''
The original HTML string.
options
string
Type: String
Default: ''
The string to be inserted into HTML.
el
Type: String
Default: body
HTML tag name, the place to insert into.
type
Type: String
Default: append
append
or prepend
.
insertMulti(html, options: Array<object>)
Like insert2() but uses a list of options to do multiple insertions.
License
MIT © EGOIST