New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ask-utils/core

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ask-utils/core

Core helpers for ask-sdk

latest
Source
npmnpm
Version
3.11.0
Version published
Weekly downloads
41
13.89%
Maintainers
1
Weekly downloads
 
Created
Source

ASK-Utils - Utility functions for ask-sdk

npm version License: MIT Maintainability Test Coverage Build Status

logo

https://ask-utils.dev

Getting started

$ npm i -S @ask-utils/core

Usage

const utils = require('ask-utils')

or

const { getRandomMessage, isLaunchRequest } = require('ask-utils')
import utils from 'ask-utils'

or

import { isLaunchRequest, getRandomMessage } from 'ask-utils'

getRandomMessage

We can easy create random response in your Alexa skill using ask-sdk.

const { getRandomMessage } = require('ask-utils')
const errorMessages = [
  'I can not here what you say, please say again.',
  'Please say again.',
  "I'm sorry, please tell me again"
]

const ErrorHandler = {
  canHandle () {
    return true
  },
  handle (handlerInput, error) {
    console.log(`Error handled: ${error.message}`)
    const message = getRandomMessage(errorMessages)
    return handlerInput.responseBuilder
      .speak(message)
      .reprompt(message)
      .getResponse()
  }
}

intentHandlers

const LaunchRequestHandler = {
  canHandle (handlerInput) {
    return isLaunchRequest(handlerInput)
  },
  handle (handlerInput) {
    const speechText = 'This is example skill'

    return handlerInput.responseBuilder
      .speak(speechText)
      .reprompt(speechText)
      .withSimpleCard(SKILL_NAME, speechText)
      .getResponse()
  }
}

const HelpIntentHandler = {
  canHandle (handlerInput) {
    return isMatchedIntent(handlerInput, 'AMAZON.HelpIntent')
  },
  handle (handlerInput) {
    const speechText = 'This is example skill'

    return handlerInput.responseBuilder
      .speak(speechText)
      .reprompt(speechText)
      .withSimpleCard(SKILL_NAME, speechText)
      .getResponse()
  }
}

development

$ git clone git@github.com:ask-utils/ask-utils.git
$ cd ask-utils
$ npm i

test

$ npm test

Lint

$ npm run lint

or

$ npm run lint -- --fix

History

-> Release Note

Contributors

NameVersion
@ArtskydJv0.13.0

Keywords

alexa

FAQs

Package last updated on 27 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts