You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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
npmnpm
Version published
Maintainers
0
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

qualweb

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