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

alexa-skills-updated

v0.3.0

Published

Alexa Skills for Node simplifies the process of creating new skills for Alexa, this package is fork verion of alexa-skills with update version of x509 to work with alpine node V10.X and V12.X.

Downloads

7

Readme

Alexa-skills-updated

Alexa Skills for Node

Alexa Skills for Node simplifies the process of creating new skills for Alexa, this pacakge is frok alexa-skills with updated x509 pacakge to make it working with node 10.x and 12.x.

Install

npm install alexa-skills-updated

This module relies on the node-x509 module for verifying that the request is coming from Amazon. If you are developing on a Windows machine, you will need to install OpenSSL to the default location, "C:\OpenSSL-Win32" or "C:\OpenSSL-Win64", before installing alexa-skills. OpenSSL is required for node-x509 to compile.

Supported Card Types

Simple Card

buildSimpleCard(title, content)

Standard Card

buildStandardCard(title, text, smallImageUrl,largeImageUrl)

Account Link Card

buildLinkAccountCard(text)

Supported Output Types

PlainText

var phrase = "Hello World!";
var options = {
  shouldEndSession: true,
  outputSpeech: phrase,
  card: alexa.buildCard("Card Title", phrase)
};

SSML

var phrase = '<speak><say-as interpret-as="spell-out">hello</say-as></speak>';
var options = {
  shouldEndSession: true,
  outputSSML: phrase
};

Session Manipulation

You can access session attributes from the 4th paramter passed to your intent function, sessionAttributes. Remember to pass it back as the 3rd paramter to alexa.send(...).

Example

Assumes you have an intent called SessionIntent with a slot called city.

alexa.intent("SessionTest", function(req, res, slots, sessionAttributes) {
  var phrase = "";
  if (sessionAttributes.previous) {
    phrase =
      'You previously said "' +
      sessionAttributes.previous +
      '". I have replaced that with "' +
      slots.city.value +
      '". Please say another city name.';
  } else {
    phrase =
      'You said "' + slots.city.value + '". Please say another city name.';
  }

  sessionAttributes.previous = slots.city.value;

  var options = {
    shouldEndSession: false,
    outputSpeech: phrase
  };

  alexa.send(req, res, options, sessionAttributes);
});

Example

var express = require("express"),
  AlexaSkills = require("alexa-skills"),
  app = express(),
  port = process.env.PORT || 8080,
  alexa = new AlexaSkills({
    express: app, // required
    route: "/", // optional, defaults to "/"
    applicationId: "your_alexa_app_id" // optional, but recommended. If you do not set this leave it blank
  });

alexa.launch(function(req, res) {
  var phrase = "Welcome to my app!";
  var options = {
    shouldEndSession: false,
    outputSpeech: phrase,
    reprompt: "What was that?"
  };

  alexa.send(req, res, options);
});

alexa.intent("Hello", function(req, res, slots) {
  console.log(slots);

  var phrase = "Hello World!";
  var options = {
    shouldEndSession: true,
    outputSpeech: phrase,
    card: alexa.buildCard("Card Title", phrase)
  };

  alexa.send(req, res, options);
});

alexa.intent("Spell hello", function(req, res, slots) {
  console.log(slots);

  var phrase =
    '<speak><say-as interpret-as="spell-out">hello</say-as></speak>!';
  var options = {
    shouldEndSession: true,
    outputSSML: phrase
  };

  alexa.send(req, res, options);
});

alexa.ended(function(req, res, reason) {
  console.log(reason);
});

app.listen(port);