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

fill-in-the-blank

v0.0.5

Published

Word generator

Downloads

13

Readme

Fill in the Blank

Add variation to your content through randomized placeholders — Great for inspiring creativity in language model prompts.

Version Workflow License Badges

const prompt = `Would a ${animal} make a good ${profession}?`;
// "Would a finch make a good scientist?"
// "Would a leopard make a good architect?"
// "Would a rhinoceros make a good farmer?"
const prompt = 'Write a poem.' + creativity;
// Write a poem. Consider mentioning running, ox, the color green, being surprised, parsley, submarine, electric kettle, rectangle, jazz music, or scientist.

Blanks

Fill in the Blank provides blanks for common types of entities:

  • animal: elephant, tiger, etc.
  • appliance: refrigerator, toaster, etc.
  • color: red, blue, green, etc.
  • degree: somewhat, very, etc.
  • emotion: happy, sad, etc.
  • exercise: running, skiing, etc.
  • greeting: hello, hi, etc.
  • letter: a, b, c, etc.
  • musicGenre: pop, rock, etc.
  • percent: 2%, 50%, 73%, etc.
  • plant: daisy, pine, tulip, etc.
  • profession: doctor, lawyer, etc.
  • programmingLanguage: Ruby, TypeScript, etc.
  • shape: circle, square, etc.
  • vehicle: bus, submarine, van, etc.

Custom blanks can be implemented using the blank function:

const clothing = blank('hat', 'shirt', 'shorts', 'shoes');
const prompt = `What color ${clothing} should I wear?`;

Prompting

To get more varied responses from a language model, you can include the creativity blank in the prompt, for example:

const prompt = 'Write a poem.' + creativity;

This will insert a random topic that the model can use to guide its response.

To generate multiple possible topics, use the ideas blank:

const prompt = `Write a story by combining two of these ideas: ${ideas}`;

Note that the behavior will be highly dependent on your model, settings, and other prompt content, and getting desirable results will likely require iteration.

Q&A

Why do I need this?

Even with high temperatures, language models will often return the same response for simple queries like "Write me a joke". Fill in the Blank can provide variation in system instructions that adds creativity to the responses. For example, try adding something like this to your system prompt:

`You are a ${emotion} ${profession} who enjoys ${exercise}. You like ${musicGenre} music and you ride a ${vehicle} to work.`;

Are the words selected randomly?

Not entirely. The order of the options is shuffled, however the blanks keep track of options that have already been used, and will use all available options before looping around. Additionally, the same option will not be returned twice in a row (even when looping around).

Do I need to invoke the blanks?

You can, but you don't have to. A blank is a function that returns a placeholder string and whose toString method also returns a placeholder string. This means that, in contexts where objects are automatically cast to strings, color and color() are functionally equivalent. Invoking them is more universally applicable, however, leaving off the parentheses may be more readable in longer content, such as prompts.