link-painter
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

link-painter Build Status

Add Query Parameters to Links in HTML

install

npm install link-painter

example

const queryParams = {
    utm_source: 'newsletter',
    utm_medium: 'link',
    utm_campaign: 'link-painter'
};
 
const html = fs.createReadStream('./sample.html', 'utf-8');
const result = await getStream(html.pipe(new LinkPainter('my.example.com', queryParams)));

yields:

<!DOCTYPE html>
<html>
    <head></head>
    <body>
        <div><a href="https://my.example.com/?utm_source=newsletter&amp;utm_medium=link&amp;utm_campaign=link-painter">click me</a></div>
        <div><a href="https://google.com">or me</a></div>
    </body>
</html>

Package Sidebar

Install

npm i link-painter

Weekly Downloads

0

Version

1.1.3

License

MIT

Unpacked Size

4.23 kB

Total Files

5

Last publish

Collaborators

  • acinader