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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mockflow

v1.1.0

Published

Send mock requests to your Dialogflow v2 fulfillment code

Readme

Mockflow

Mockflow lets you send mock requests to your Dialogflow fulfillment code, for offline unit testing.

The Basics

Connect to your fulfillment code and send a mock intent request

const Mockflow = require('mockflow');
// Import the Firebase Functions code for your Dialogflow Fulfillment Webhook
// This assumes that the file is in the same directory as index.js - change as necessary
const app = require('.');

// Initialize Mockflow with your Dialogflow project's name and the webhook handler
// Change app.handler if you exported your handler with a custom name
const mock = new Mockflow('my-voice-app', app.handler);

// Send an intent request and check results
it("Enter a description of what should happen here", async function () {
    let result = await mock.intent('My Intent Name').send()
    
    // Provide the result and a string array with keywords/phrases to look for in in the response
    return mock.existsAndMatches(result, ['words','to','look for'])
});

Further customization

The above example creates a simple intent request using sensible defaults for Dialogflow's many parameters. However, you can use the request builder's with...() methods to set the other parameters.

it("Should respond by saying that my favorite color is blue", async function () {
    // Send an intent request
    let result = await mock.intent('Favorite Color Intent')
        .withParameter('Color', 'blue')
        .withQueryText('i like blue')
        .send()

    return mock.existsAndMatches(result, ['favorite','color','blue'])
});

Available Overrides

  • withQueryText(queryText)
  • withParameter(name, value)
  • withAllRequiredParamsPresent(allRequiredParamsPresent)
  • withFulfillmentText(fulfillmentText)
  • withFulfillmentMessage(fulfillmentMessage)
  • withOutputContext(outputContext)
  • withIntentDetectionConfidence(intentDetectionConfidence)
  • withDiagnosticInfo(name, value)
  • withLanguageCode(languageCode)
  • withOriginalDetectIntentRequest(originalDetectIntentRequest)

Limitations

  • Only Dialogflow v2 fulfillments are supported. v1 has not been tested and probably won't work.

Acknowledgements