1.0.1 • Published 6 years ago
recipe-to-json v1.0.1
Installation
npm install -save recipe-to-json
Usage
import { Recipe } from 'recipe-to-json'
var recipe = new Recipe({"Wait":[{"Pour onto":[{"Crack":["egg"]},{"Spread":[{"Heat":["pan","45C"]},"butter"]}]},"5min"]})
console.log(recipe.toString())
/*
returns:
"Wait with
Pour onto with
Crack with
egg
and
Spread with
Heat with
pan
and
45C
and
butter
and
5min"
*/
var anotherRecipe = new Recipe({"Wait":[{"Pour onto":[{"Crack":["egg"]},{"Spread":[{"Heat":["pan","45C"]},"butter"]}]},"10min"]})
console.log(recipe.getDistance(anotherRecipe))
/*
returns:
1
*/