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

curlspy

v1.0.21

Published

A CLI tool to scrape URLs and generate curl commands using Puppeteer

Downloads

24

Readme

curlspy

curlspy is a CLI tool to scrape URLs and generate curl commands using Puppeteer. It allows you to intercept network requests and convert them into curl commands for easy replication and testing.

Features

  • Scrape URLs and generate cURL commands
  • Convert cURL commands to JSON
  • Generate Swagger specifications from JSON
  • Save scraped URLs and cURL commands to files
  • Periodically save URLs and cURL commands

Installation

To install CurlSpy, you need to have Node.js version 18 or higher. Then, you can install CurlSpy globally using npm:

    npm install -g curlspy

    Usage
    The curlspy CLI tool accepts the following optional arguments:

    --skipKeywords (-k): Comma separated skip keywords (default: "dist,assets,embed,Icons,static,auth,constants,locales,dcp-oauth,interaction,.js,.css,.ttf,.pdf,.png,.svg,.jpg,.ico,data:,www.google,analytics.,px.ads,googleads,/t.co")
    --methods (-m): HTTP methods to scrape (default: "POST,PUT,DELETE,GET")
    --url (-u): URL to scrape (default: "https://www.google.com")
    --interval (-i): Interval to save to file in seconds (default: 15)

Usage

Scrape URLs and Generate cURL Commands

  • To scrape URLs and generate cURL commands, run:
    curlspy -u <url> -d <directory>

Options:

  • -u, --url : The URL to scrape. (Default: https://www.google.com)
  • -d, --directory : Directory to save files. (Default: Current working directory)
  • -ik, --includeKeywords ', 'Comma separated include keywords', ''
  • -b, --serverUrl ': 'provide server base url for swagger', ''
  • -sk, --skipKeywords : Comma-separated list of keywords to skip URLs. (Default: dist,assets,embed,Icons,static,auth,constants,locales,dcp-oauth,interaction,.js,.css,.ttf,.pdf,.png,.svg,.jpg,.ico,data:,www.google,analytics.,px.ads,googleads,/t.co)
  • -m, --methods : HTTP methods to scrape. (Default: POST,PUT,DELETE,GET)
  • -i, --interval : Interval to save to file in seconds. (Default: 15)
  • -r, --restore : option to load exist curl and urls to continue with the same otherwise it will create new
  • -a, --all : collect all curl, defaults to true

Generate Swagger Specification

    curlspy -g -j <json-file> -s <swagger-file>

Options:

  • -g, --generate-swagger: Flag to generate Swagger specification.
  • -j, --json-file : Path to the JSON file with cURL commands. (Default: curl-to-json.json)
  • -s, --swagger-file : Path to save the generated Swagger specification. (Default: swagger.json)

Example

  • Start scraping and generating cURL commands:
    curlspy -u https://www.example.com -d ./data
  • Generate Swagger specification from the cURL commands:
    curlspy -g -j ./data/curl-to-json.json -s ./data/swagger.json

CLI Commands

Display help information:

    curlspy -h

Development

  • To contribute to CurlSpy, clone the repository and install dependencies:
    git clone https://github.com/Avinashkumar8694/curlspy.git
    cd curlspy
    npm install
  • To run the tool locally:
    npm start -- -u <url> -d <directory>

License

  • CurlSpy is licensed under the MIT License. See the LICENSE file for more details.

Author

Avinash Kumar Gupta Email: [email protected] GitHub: Avinashkumar8694

This README.md file includes installation instructions, usage examples, CLI commands, and development guidelines. You can adjust the details to fit any additional requirements or changes to the project.