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 🙏

© 2026 – Pkg Stats / Ryan Hefner

parse-recipe

v0.1.0

Published

Parse recipe ingredient lines and instruction mentions.

Readme

parse-recipe

This package provides utilities for parsing food recipes, both "ingredient lines" and "instructions lines".

Example usage:

import { readFileSync } from "node:fs";

import { analyzeRecipeInstructions, createLexiconFromText, createParser, ingredientToString } from "parse-recipe";

const lexicon = createLexiconFromText(readFileSync("ingredients-lexicon.txt", 'utf8'));
const parser = createParser({ lexicon });
const result = analyzeRecipeInstructions({
    ingredients: 
`4 egg yolks (try using the egg whites in Dutch Baby with Egg Whites)
¼ cup sugar
1 cup heavy cream
6 oz dark chocolate or semisweet chocolate chips (1 cup)
1.5 cup heavy cream`.split('\n'),
    instructions:
`Chop the dark chocolate quite small (I use a small food processor that was probably meant for spices or coffee).
Beat egg yolks in small bowl with electric mixer on high speed about 3 minutes or until thick and lemon colored.
Gradually beat in sugar.
Heat 1 cup whipping cream in 2-quart saucepan over medium heat until hot. Gradually stir at least half of the hot whipping cream into the bowl with egg yolk mixture (to temper it); stir back into hot cream in saucepan.
Cook over low heat about 5 minutes (or less), stirring constantly, until mixture thickens (do not boil).
Put finely-chopped chocolate into a bowl, ideally one that has a lid so it can go in the fridge to chill.
Gradually add the hot egg mixture (custard) into the chocolate, I add it by quarter cups, stirring well after each addition. The mixture should *not* have oil separated (that means you added the egg too fast) - if it does, the resulting mousse will be less smooth (but still very tasty).
Cover and refrigerate, 2-4 hours.
Beat 1 1/2 cups whipping cream in chilled medium bowl with electric mixer on high speed until stiff. Fold chocolate mixture into whipped cream with a rubber scraper. (I've also done this by adding ~1/4c of the cream into the chocolate & mixing, to loosen the chocolate up, before adding the now smoother chocolate into the whipped cream).
Chill for at least an hour, 2-3 is best. If you eat it without chilling, it's pretty tasty, but if you wait, then it's astoundingly good.`.split('\n')
    ],
}, parser, { lexicon });

Output:

Ingredients:

  1. 4 egg yolks
  2. 1/4 c sugar
  3. 1 c heavy cream
  4. 6 oz dark chocolate chips [or semisweet chocolate chips] {eq 1 c}
  5. 1.5 c heavy cream

Instructions:

  1. Chop the [dark chocolate][4] quite small (I use a small food processor that was probably meant for spices or coffee).
  2. Beat [egg yolks][1] in small bowl with electric mixer on high speed about 3 minutes or until thick and [lemon][?] colored.
  3. Gradually beat in [sugar][2].
  4. Heat 1 cup whipping [cream][3] in 2-quart saucepan over medium heat until hot. Gradually stir at least half of the hot whipping [cream][5] into the bowl with [egg yolk][1] mixture (to temper it); stir back into hot [cream][3] in saucepan.
  5. Cook over low heat about 5 minutes (or less), stirring constantly, until mixture thickens (do not boil).
  6. Put finely-chopped [chocolate][4] into a bowl, ideally one that has a lid so it can go in the fridge to chill.
  7. Gradually add the hot [egg][1] mixture (custard) into the [chocolate][4], I add it by quarter cups, stirring well after each addition. The mixture should not have oil separated (that means you added the [egg][1] too fast) - if it does, the resulting mousse will be less smooth (but still very tasty).
  8. Cover and refrigerate, 2-4 hours.
  9. Beat 1 1/2 cups whipping [cream][5] in chilled medium bowl with electric mixer on high speed until stiff. Fold [chocolate][4] mixture into whipped [cream][3] with a rubber scraper. (I've also done this by adding ~1/4c of the [cream][5] into the [chocolate][4] & mixing, to loosen the [chocolate][4] up, before adding the now smoother [chocolate][4] into the whipped [cream][3]).
  10. Chill for at least an hour, 2-3 is best. If you eat it without chilling, it's pretty tasty, but if you wait, then it's astoundingly good.