New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@recipecloudapp/ingredient-parser

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@recipecloudapp/ingredient-parser

Lightweight ingredient line parser (shared across web, cloud, iOS)

latest
npmnpm
Version
0.1.6
Version published
Weekly downloads
7
75%
Maintainers
1
Weekly downloads
 
Created
Source

@recipecloudapp/ingredient-parser

A lightweight, language-aware ingredient line parser.
It normalizes quantities (fractions, ranges, decimals), units (tsp/tablespoon/cup/etc.), and extracts ingredient names plus notes.
Built for use across Recipe Cloud’s web app, server functions, and iOS app (via JavaScriptCore).

Ships as ESM, CJS, and IIFE (global window.IngParser) for maximum compatibility.

Install

npm i @recipecloudapp/ingredient-parser
# or: pnpm add @recipecloudapp/ingredient-parser
# or: yarn add @recipecloudapp/ingredient-parser

Usage

import { parseLine, parseLines } from '@recipecloudapp/ingredient-parser';

const node = parseLine('1/2 cup tomato sauce (no salt)');
// → {
//   type: 'item',
//   quantity: 0.5,
//   unit: { canonical: 'cup', raw: 'cup', abbr: 'cup', display: 'cup' },
//   ingredient: 'tomato sauce',
//   postNote: 'no salt'
// }

Or in the browser (IIFE build):

<script src="dist/index.iife.js"></script>
<script>
  const result = window.IngParser.parseLines([
    '1 teaspoon oregano, optional',
    'For the Quick Sauce:',
    '1/2 cup tomato sauce (no salt)'
  ]);
  console.log(result.items);
</script>

Features

  • Parses mixed numbers, fractions, and ranges (1 1/2, ½, 1–2).
  • Normalizes units across multiple languages (tsp, cda, cas, etc.).
  • Extracts and separates ingredient name, notes, and trailing parentheticals.
  • Supports group headings like For the sauce:.

© 2025 Recipe Cloud LLC. All rights reserved.

FAQs

Package last updated on 18 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts