1.0.1 • Published 6 years ago

recipe-to-json v1.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

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
*/
1.0.1

6 years ago

1.0.0

6 years ago