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

leviathan

v1.1.14

Published

An Actions on Google plugin and CLI tool for advanced use cases

Downloads

24

Readme

EXPERIMENTAL - DO NOT USE

Okay, so going back and forth between the Dialogflow console and code editor just to update training phrases is a pain. It’s really easy to mess up the entity names and intent names (because the developer has to manually type these things in) between the developer console and code, and most importantly mature developers are going to want the data that currently lives in the Dialogflow GUI (training phrases, entity synonyms, etc…) under version control.

Leviathan tries to address that, by giving you a way to keep all that stuff (the training phrases and entity strings etc...) alongside your fulfillment logic and having a single simple way to deploy all of it at the same time.

const { Intent } = require('leviathan');

const intent = new Intent({

  name: 'book-room',

  trainingPhrases: [
    'Is <roomName>Atlantis</roomName> booked right now?',
    'Is <roomName>Lemuria</roomName> open?',
  ],

  fulfillment: (conv, {roomName}) => {
    conv.ask(roomName + ' is busy right now');
  }

});

and for that "roomName" Entity:

const { EntityType } = require('leviathan');

const entityType = new EntityType({

  name: 'roomName',

  entities: [
    ['Atlantis', 'the land beneath the sea'],
    ['Lemuria', 'Kumari Kandam'],
    ['Mu']
  ]

});

A few more details here and there, then it's as simple as

leviathan deploy

and the Dialogflow details are pushed to Dialogflow, and the fulfillment code is deployed to Firebase Functions.

Setup

Okay, first we'll need a project: I recommend going (here)[https://github.com/actions-on-google/dialogflow-webhook-boilerplate-nodejs] (which is the Actions on Google Dialogflow boilerplatiest of the boilerplate Actions) and clicking on the "Add to Dialgflow" button, which will create a project and route you to the console. Keep that window open for a sec.

Next, we'll clone the git repo locally and tell firebase to use the project (you can get a list of firebase projects with the command firebase list. If you don't have the firebase-cli installed yet, do that), and firebase deploy.

Okay, so at this point you've created a new Dialogflow project, cloned all that code down to your local machine from Github, and deployed it up to Firebase. That last step should have printed a url in your terminal. Copy that, and go back to the Dialogflow web console (the window I told you to leave open), go to the Fulfillment section (button on the left nav) toggle on the webhook fulfillment switch and paste that url in.

Phew, okay, now we're almost in business.

I'm sorry about this, but the next bit is the trickiest and I don't know how to get around it yet.

You're going to need to set up the credentials. At least, there's a guide (here)[https://cloud.google.com/docs/authentication/getting-started]

Once you've don ALL that, we're finally ready to begin.

I suggest taking a look at the (leviathan examples repo)[https://github.com/aog-leviathan/leviathan-examples/tree/master/simple-example/functions]