Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@qualweb/counter

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qualweb/counter

Counts elements of a webpage by role and by tag

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
167
increased by7.05%
Maintainers
0
Weekly downloads
 
Created
Source

Counter module

Counts how many of each role and how many of each tag exists in the webpage.

How to use

This package is intended to be used with @qualweb/core.

Add both packages to your project:

npm i --save @qualweb/core @qualweb/counter

In your own code, pass an instance of the Counter class to QualWeb's evaluate method:

import { Counter } from '@qualweb/counter';
import { QualWeb } from '@qualweb/core';

async function main() {
  const qw = new QualWeb();

  await qw.start();

  const counterInstance = new Counter();

  const urlToEvaluate = 'https://www.google.com';

  const report = await qw.evaluate({
    url: urlToEvaluate,
    modules: [counterInstance],
  });

  await qw.stop();

  console.debug(report[urlToEvaluate]);
}

License

ISC

Keywords

FAQs

Package last updated on 30 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc