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

confabulation

v1.0.0

Published

JavaScript testing utilities for Alexa

Readme

Confabulation

pipeline status coverage report

Confabulation is a JavaScript test tool to assist with BDD / Cucumber for Amazon Alexa skills.

Help & support

  • Issue Tracker: https://gitlab.com/dan.malec/confabulation/issues

Install

Confabulation is available as an npm module.

$ npm install confabulation

Dependencies

Confabulation depends on a local DynamoDB instance being present. It has been tested with both

This requires a modification to your skill's index.js.

const aws = require('aws-sdk');

// ...

exports.handler = function(event, context, callback) {
  const alexa = Alexa.handler(event, context);

  if (process.env.NODE_ENV === 'test') {
    alexa.dynamoDBClient = new aws.DynamoDB({
      endpoint: process.env.ENDPOINT_URL || 'http://localhost:8000/',
      accessKeyId: 'dynamo',
      region: 'test',
      secretAccessKey: 'secret',
    });
  }

  // ...
};

And a change to your package.json:

  "scripts": {
    "cucumber": "NODE_ENV=test cucumber-js"
  }

And changes to CI (E.G. .gitlab-ci.yml):

services:
  - name: dwmkerr/dynamodb
    alias: dynamodb

variables:
  ENDPOINT_URL: "http://dynamodb:8000/"

Usage

Setup

Create an endpoint in world.js:

const skill = require('../../index.js');
const { setWorldConstructor } = require('cucumber');
const { Endpoint } = require('confabulation');

class CustomWorld {
  constructor({attach, parameters}) {
    this.attach = attach;
    this.parameters = parameters;
    this.endpoint = new Endpoint()
      .withSkill(skill)
      .withApplicationId('<your-skill-id>')
      .withTableName('<your-table-name>')
      .withDbUrl(process.env.ENDPOINT_URL || 'http://localhost:8000/')
  }
}

setWorldConstructor(CustomWorld);

Invoking the skill

You can then add invocations in steps:

When('the user opens the skill', function(callback) {
  this.endpoint.say(new Intent('LaunchIntent'), callback);
}

Including passing in slot data:

When('the user says the number {int}', function(number, callback) {
  this.endpoint.say(new Intent('CountIntent').withSlot('count', number), callback);
});

When('the user says {word}', function(value, callback) {
  const value_id = value.toUpperCase();
  this.endpoint.say(new Intent('SelectListItemIntent').withSlot('list_item', value, value_id), callback);
});

Working with session data

You can set session data:

Given('the user has {int} items', function(value) {
  this.endpoint.setAttribute('item_count', value);
});

And check session data:

Then('the player should have {int} items', function(value) {
  expect(this.endpoint.getAttribute('item_count'))).to.equal(value);
});

Working with response data

You can check the response:

Then('the user should hear {string}', function(phrase) {
  expect(this.endpoint.response.response.outputSpeech.ssml).to.contain(phrase);
});

Credits

Portions of confabulation are copied/modified from Joan Gamell Farre's alexa-conversation module (as indicated in the source).