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

insomnia-plugin-count-in-page

v1.0.0

Published

Count and list the amount of occurrences of a regex or string in the response body

Downloads

1,211

Readme

insomnia-plugin-count-in-page

Count the total occurrences of a matched string or regular expression in a response body in Insomnia REST Client, see a list of all lines where a match was found

Installation

From Insomnia Plugin Hub

  1. Navigate to https://insomnia.rest/plugins/insomnia-plugin-count-in-page
  2. Click Install Plugin
  3. Click Open
  4. Once opened, click Install

From the Insomnia App

  1. Go to Application > Preferences or click the cog icon (⚙️)
  2. Navigate to the Plugins tab
  3. Enter insomnia-plugin-count-in-page
  4. Click Install

Manual Install

  1. Using a terminal, cd into your Insomnia plugins folder - See Insomnia Docs
  2. Run git clone https://github.com/okdv/insomnia-plugin-count-in-page
  3. Run cd insomnia-plugin-count-in-page

Usage

  1. Click the dropdown arrow of the request you would like to search the response of and select "Count in Page"
  2. Input as string or regular expression (Note: just like native Find in Page in Insomnia, wrap your input in '/' to treat at RegEx. e.g. EXAMPLE is a string, /EX[A-Z]+/ is a RegEx.) and hit Count
  3. Wait a moment, you'll notice the request is automatically resent, shortly after you will get a popup showing the input, total matches, total lines, and a list of all of the above
  4. Any subsequent requests will not use this input, you must start from Step 1 each time you want to use this plugin

Known Limitations

  • Cannot use this plugin on historical responses, when you attempt to "Count in Page" it will resend the request and generate a new response to count in. There is no current workaround for this aside from potentially using other plugins to fake responses.
  • Only designed to work with XML and JSON, however the 'total matches' count should work regardless of format. Matched lines may not as responses often do not come pre-formatted, and so they are formatted with pretty-data.js based on their content-type, and at this time only XML and JSON content-types are checked, but if the response comes pre-formatted then hey, it will probably work.
  • Cannot match across multiple lines. e.g. /<lineOne\/>\s*[\r\n]{1}\s*<lineTwo\/>*/ would not work as the response is broken into lines and each line is independently searched for a match. If needed, removing all formatting to find occurrences like this can be done, but as of now it seems like an edge case so this is not a feature at this time.

Enable / Disable Plugin

It's disabled by default, can only be enabled for a single request by "Count in Page" in request dropdown. Once done once, the plugin goes back to doing nothing

Using Insomnia Plugins Settings

  1. Go to Application > Preferences or click the cog icon (⚙️)
  2. Navigate to the Plugins tab
  3. Toggle off this plugin

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as needed.

License

MIT


Boostrapped using create-insomnia-plugin