npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@contrast/crawler

v1.1.1

Published

The Contrast Crawler exercises web apps to support security analysis with a Contrast agent

Downloads

32

Readme

Contrast Crawler Project

This project uses application route data retrieved from TeamServer to seed a web crawler implemented using Crawlee and Playwright .

To Run Contrast Crawler

Customize example.yaml with your TeamServer user credentials (not agent credentials), the TeamServer name of the application to test, and the base URL of the application to test.

Install the crawler globally:

$ npm i -g @contrast/crawler

The launch command:

$ npx @contrast/crawler /path/to/contrast.yaml

To Configure Custom Fake Input

In the faker.json file, each object corresponds to a method in the faker.js API

For, example

  {
    "module": "location",
    "name": "streetAddress"
  }

corresponds to: https://fakerjs.dev/api/location.html#streetaddress

This method will be called and used to generate a fake address when an input field named "address" is encountered by the crawler.

Some objects have a field called "predicates". These are used if your application has unique identifiers for input. For example, "surname" might be used to identify a field where a person's last name is expected. The faker.js method for generating last names is called lastName thus, a predicate is used to retrieve the correct method.

Predicates can be added or removed, according to the needs of your application. They can be stored as a string or an array of strings.

Some objects have a field called "input". These can be used if the faker method needs input to produce a specific kind of output. For example, if you need a zip code to be from New York that needs to be passed into the zipcode method as {state: 'New York'} which would have to be added as "input": "{state: 'New York'}" to the zipcode object in the JSON.

Some objects have a field called "fn". These are used for post-processing fake input. For example, the birthdate method outputs an instance of a Date object which could be invalid input for your application. Adding

    "fn": {
      "methods": [
        {
          "name": "toISOString"
        },
        {
          "name": "split",
          "input": "T"
        }
      ],
      "idx": 0
    }

to the birthdate object does the following: converts the Date object to an ISOString then splits the resulting string by "T" and returns the element at index 0 so that it preserves the year-month-day format wihtout including the timezone.