{"_id":"@asgeiralbretsen/webcompare","_rev":"1-3aa1d6648392c02ec630f54469244a9e","name":"@asgeiralbretsen/webcompare","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@asgeiralbretsen/webcompare","version":"0.1.0","description":"A package for comparing live websites with stored snapshots","main":"webcompare.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Albretsen/WebCompare.git"},"author":{"name":"Asgeir Albretsen"},"license":"ISC","bugs":{"url":"https://github.com/Albretsen/WebCompare/issues"},"homepage":"https://github.com/Albretsen/WebCompare#readme","_id":"@asgeiralbretsen/webcompare@0.1.0","gitHead":"6e1f27a3ac478c7881fd3e97c474d4c805bbd020","_nodeVersion":"20.10.0","_npmVersion":"10.2.5","dist":{"integrity":"sha512-uCQ+PfX1T2Cu1WIj0RUv4MNw27db8J3dVTgrBS0g0azxojYaDWBZTcAXB9mkM0ntdwtaPCGwwPG5d/ixbLiUFg==","shasum":"089893174a4405cd063ea530fe28f02372b0d99a","tarball":"https://registry.npmjs.org/@asgeiralbretsen/webcompare/-/webcompare-0.1.0.tgz","fileCount":4,"unpackedSize":7905,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVM+vjCtOyMeBV2ursEGxces2E2Ntk9ZZuaq//pcSIlQIhAMIx+Cnl23fmqkQ8Z1LkEIOcbtBO0NCV8PW7onHZ6L4t"}]},"_npmUser":{"name":"asgeiralbretsen","email":"asgeir.albretsen@gmail.com"},"directories":{},"maintainers":[{"name":"asgeiralbretsen","email":"asgeir.albretsen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webcompare_0.1.0_1713454803028_0.8241869530116348"},"_hasShrinkwrap":false},"0.1.1":{"name":"@asgeiralbretsen/webcompare","version":"0.1.1","description":"A package for comparing live websites with stored snapshots","main":"webcompare.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Albretsen/WebCompare.git"},"author":{"name":"Asgeir Albretsen"},"license":"ISC","bugs":{"url":"https://github.com/Albretsen/WebCompare/issues"},"homepage":"https://github.com/Albretsen/WebCompare#readme","_id":"@asgeiralbretsen/webcompare@0.1.1","gitHead":"a8702a3e38f38e09a1bc3666b71fa7581bdab5eb","_nodeVersion":"20.10.0","_npmVersion":"10.2.5","dist":{"integrity":"sha512-ylpVhNY11f46YZT0EDD1UEHRgzFpkTo+5qt5fwDJEOON9/xK8w3NtoQ0CMRIMzPtRCy5RrhvTd8kbPo/inCd0w==","shasum":"27c3d7d75f67de5c91f52f780eb6fb130f57fee8","tarball":"https://registry.npmjs.org/@asgeiralbretsen/webcompare/-/webcompare-0.1.1.tgz","fileCount":4,"unpackedSize":8152,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXFUswuBuayO+gv7WqbRDBRcrkT/dzf+LyTrgSwbRQ+gIgHnOVK7iJJEarqoRsjpwm3Hus3SwpDf0lQyBvsPBe0Cw="}]},"_npmUser":{"name":"asgeiralbretsen","email":"asgeir.albretsen@gmail.com"},"directories":{},"maintainers":[{"name":"asgeiralbretsen","email":"asgeir.albretsen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webcompare_0.1.1_1713525296186_0.5705646214802524"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-18T15:40:02.890Z","0.1.0":"2024-04-18T15:40:03.195Z","modified":"2024-04-19T11:14:56.515Z","0.1.1":"2024-04-19T11:14:56.343Z"},"maintainers":[{"name":"asgeiralbretsen","email":"asgeir.albretsen@gmail.com"}],"description":"A package for comparing live websites with stored snapshots","homepage":"https://github.com/Albretsen/WebCompare#readme","repository":{"type":"git","url":"git+https://github.com/Albretsen/WebCompare.git"},"author":{"name":"Asgeir Albretsen"},"bugs":{"url":"https://github.com/Albretsen/WebCompare/issues"},"license":"ISC","readme":"# WebCompare\r\n\r\n**WebCompare** is an advanced Node.js package designed for developers to automate the process of comparing live websites with their archived snapshots. It is particularly useful for detecting text changes, attribute modifications, style updates, or structural changes in the DOM. WebCompare offers flexible solutions to accommodate a variety of web monitoring needs.\r\n\r\n## Features\r\n\r\n- **Text Comparison**: Identifies updates in the text content of web elements.\r\n- **Attribute Comparison**: Monitors changes in attributes of elements, such as `src` in `<img>` tags.\r\n- **Style Comparison**: Observes adjustments in the computed style of elements, including properties like `color` and `font-size`.\r\n- **Children Comparison**: Tracks structural alterations within the child elements of any parent node.\r\n- **Custom Comparison**: Allows for the implementation of bespoke logic to address complex or specific comparison demands.\r\n\r\n## Installation\r\n\r\nTo install **WebCompare**, execute the following command using npm:\r\n\r\n```\r\nnpm install @asgeiralbretsen/webcompare\r\n```\r\n\r\n## Usage\r\n\r\nBegin by requiring the package in your Node.js script:\r\n\r\n```\r\nconst compareWebContent = require('@asgeiralbretsen/webcompare');\r\n```\r\n\r\n## Example: Comparing Text Content\r\n\r\n```\r\n(async () => {\r\n    const url = \"https://example.com\";\r\n    const comparisons = [{\r\n        Selector: \"p.intro\",\r\n        Type: \"text\",\r\n        Value: \"Expected intro text\"\r\n    }];\r\n\r\n    const changes = await compareWebContent(url, comparisons);\r\n    console.log(changes);\r\n})();\r\n```\r\n\r\n## Example: Comparing Attributes\r\n\r\n```\r\n(async () => {\r\n    const url = \"https://example.com\";\r\n    const comparisons = [{\r\n        Selector: \"p.intro\",\r\n        Type: \"attribute\",\r\n        Attributes: [\"src\"]\r\n    }];\r\n\r\n    const changes = await compareWebContent(url, comparisons);\r\n    console.log(changes);\r\n})();\r\n```\r\n\r\n## API Reference\r\n\r\n**compareWebContent(url, comparisons)**: This function compares web content against provided snapshot values using the specified comparison details.\r\n\r\n## Licence\r\n\r\n**WebCompare** is licensed under the ISC License.","readmeFilename":"readme.md"}