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

flutterance

v0.0.11

Published

App to help define Alexa utterances more easily

Downloads

32

Readme

Flutterance

Build Status

A syntax to make Alexa utterances less painful to define.

Getting started

npm install -g flutterance

convert a file

flutterance input.txt output.txt

syntax

Use [aaa|bbb] to indicate choices of either or.

[aaa|bbb]

Will be expanded to

aaa
bbb

These can be nested, thus:

[Hello|Hi|Good [Morning|Afternoon|Evening]] Alexa

Will get expanded to:

Hello Alexa
Hi Alexa
Good Morning Alexa
Good Afternoon Alexa
Good Evening Alexa

It is also possible to make the words optional by suffixing with a ?

[Wow]? This is [really|very]? good

Will get expanded to:

This is good
This is really good
This is very good
Wow This is good
Wow This is really good
Wow This is very good

To inlcude combinations of many words, use + or *. These work regex style where they will give you one-or-more or zero-or-more words from the list. It will not, however, add any spaces or allow the words to appear out of order.

Hello[ John| Edward| Smith]+
My[ big| yellow| metal]* box

Will expand to:

Hello John
Hello Edward
Hello Smith
Hello Edward Smith
Hello John Edward
Hello John Smith
Hello John Edward Smith
My box
My big box
My yellow box
My metal box
My yellow metal box
My big yellow box
My big metal box
My big yellow metal box

If the words can be applied in any order, you can use the ~ operator in combination with * or + and flutterance will produce all sentences with any order of the options. (Technically you could combine ~ with ? or just on it's own, but it won't make much difference!!)

My[ big| yellow| metal]~* box

Will expand to:

My box
My big box
My yellow box
My metal box
My big yellow box
My big metal box
My yellow big box
My yellow metal box
My metal big box
My metal yellow box
My big yellow metal box
My big metal yellow box
My yellow big metal box
My yellow metal big box
My metal big yellow box
My metal yellow big box

If you need the words to expand from the left or right, you can use the > and < in combination with * or + to accomplish this.

I have a [really |very |nice]<* house
I want [some| hot |pepperoni]>* pizzas

expands to:

I have a house
I have a nice house
I have a very nice house
I have a really very nice house
I want pizzas
I want some pizzas
I want some hot pizzas
I want some hot pepperoni pizzas

If you need more control over how many elements get chosen you can use the (n) or (n,m) syntax in place of *, + or ?. Here n and m are integers or you can use * to represent the max length. (n) will give expansions of exactly n options. (n,m) will give expansions of between n and m options (inclusive). Naturally these can be combined with ~, < or > if desired.

... [red |green |blue ](2) ...

expands to:

... green blue ...
... red green ...
... red blue ...

and

... [one |two |three |four ](2,*) ...

expands to:

... three four ...
... two three ...
... two four ...
... one two ...
... one three ...
... one four ...
... two three four ...
... one three four ...
... one two three ...
... one two four ...
... one two three four ...