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

mumble-js

v1.0.1

Published

A simple Javascript framework for adding voice commands to a web site using the web speech recognition API. Based on annyang.js.

Downloads

16

Readme

#mumble.js A simple Javascript framework for adding voice commands to a web site using the web speech recognition API. Supports RegEx command syntax and the CommonJS/AMD module syntax.

Forked from and inspired by https://github.com/TalAter/annyang.

##Demo For a demo of the original library (annyang.js), see https://www.talater.com/annyang. The end-user experience is basically the same.

##Usage

  • If using node.js with browserify for example you can run npm install mumble-js within your app to get the latest version. Then require('mumble-js').
  • If you're using a plain web app include mumble.js or mumble.min.js directly on your site.

Then define some commands and start the device:

// if using node.js, else leave out
var Mumble = require('mumble-js');

// for all options, see the docs
var mumble = new Mumble({
    language: 'en-US',
    debug: false, // set to true to get some detailed information about what's going on

    // define some commands using regex or a simple string for exact matching
    commands: [{
        name: 'appointment',
        command: /^book (.+) for me (today|tomorrow) at (\d+)$/,

        action: function(type, date, hour) {
            console.log('Making an appointment for %s %s at %d', type, date, hour);
        }
    }, {
        name: 'google',
        command: /^google (.+) for me\s?(please)?$/,

        action: function(query, polite) {
            if (polite) {
                // google the query
            } else {
                console.log('I will google that for you but only if you say please');
            }
        }
    }],

    // define global callbacks (see docs for all)
    callbacks: {
        start: function(event) {
            console.log('Starting..');
        }

        // start, end, speech, recognizeMatch, etc
    }
});

// add a command afterwards, or anytime
mumble.addCommand('clock', 'what is the time', function() {
    console.log(new Date());
});

// start listening
mumble.start();

##Microphone permissions and HTTP(S) Chrome's implementation of SpeechRecognition behaves differently based on the protocol used:

  • https:// Asks for permission once and remembers the choice.
  • http:// Asks for permission repeatedly on every page load. Results are also returned significantly slower in HTTP.

For a great user experience, don't compromise on anything less than HTTPS (an SSL certificate can be as cheap as $5).

While developing, you can use a self-signed SSL certificate described here: https://www.sslshopper.com/article-how-to-create-and-install-an-apache-self-signed-certificate.html.

##API Documentation Check out mumble.md in the docs/ folder for the public API methods and all available options.

##Authors

  • Johan Johansson: https://github.com/swemaniac
  • Tal Ater: https://github.com/TalAter (the original annyang.js author)

##License Licensed under MIT.