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

praise

v1.0.2

Published

Do stuff with voice in the browser.

Downloads

8

Readme

Praise 🙌🏿

Praise is a client-side helper that... well, helps do things using your voice in a browser environment. This project uses the Web Speech API, which is still an experimental browser technology and is only currently supported in Google Chrome. Use with discretion. At some point, as the Web Speech specification moves closer to finalization and inclusion, Praise aims to keep up with the changes.

Disclaimer: the current SpeechRecognition API (part of the Web Speech API) supported in Chrome requires an internet connection and connects to Google's Web Speech service under the hood.

Motivation

I created this project on a Saturday afternoon in just a few hours in order to demonstrate the welcoming, efficient nature of JavaScript for my talk at JSConf EU.

Getting Started

To get up and running with Praise, it's pretty standard: simply install it with yarn.

  • yarn add praise

... done.

Of course, you may also use npm if you are so inclined (npm i praise --save).

Basic Usage

Praise exports a createPraise function that returns a Praise instance that can be started and stopped at your leisure, in a browser that can and wants to listen. Here's how a simple project can be set up.

Be sure to include the compiled version of this file in a HTML file, using Parcel, Webpack, Poi or a similar bundler.

import { createPraise } from "praise";

const whenISay = {
  ooga: () => alert("booga"),
  "am i pretty": () => alert("the prettiest!")
};

const myPraiseListener = createPraise(whenISay); // for customizing, use createPrase(whenISay, myOptions)
myPraiseListener.start();

Starting this app in a browser, and then saying either "ooga" or "am I pretty" will execute their respective functions. Pretty cool, eh? This allows you to do literally anything that you can do programatically with your voice.

Options

createPraise takes an optional second argument specifying the following configuration options for more fine-grained control. Here are the defaults, when everything is left blank:

{
  /** Indicates whether Praise should keep listening or stop listening after the first match. */
  keepListening: true;

  /** Indicates whether Praise should return results _as you speak_ or after you stop speaking. */
  onlyWhenIStop: false;

  /** A minimum threshold of confidence for matches. A higher number hear means more accurate, but fewer matches. */
  confidence: 0.8;

  /** A callback executed on successful execution of a phrase callback that gets the result of the callback for a phrase. */
  onSuccess: () => undefined;
}

Usage with React

Praise also has React bindings! react-praise can do some nifty things in a React app, like change presentation slides or other things. Feel free to submit Pull Requests that demonstrate your cool idea/use case!

Contributing

Open issues and make PRs as you wish.