0.0.3 • Published 2 years ago

cooklang-parser v0.0.3

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

cooklang-parser

installation

npm install cooklang-parser

usage

This package provides two exports: Recipe and parse. Both take a recipe string and return the parsed recipe as on object. The result of parse has two keys, steps and metadata. Recipe additionally adds a list of ingredients and a list of cookware:

const recipeString = `
>> name: test-recipe

1. first step
2. second step
`

parse(recipeString) // { steps: [...], metadata: { ... } }
Recipe(recipeString) // { steps: [...], metadata: { ... }, ingredients: [...], cookware: [...] }