1.0.3 โ€ข Published 4 months ago

@mr_fozan/recipe.js v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

npm package

Recipe.js is a powerful Node.js module that allows you to work with recipes.

๐Ÿ“ฆ Install

NPM

npm instal @mr_fozan/recipe.js

YARN

$ yarn add @mr_fozan/recipe.js

๐Ÿš€ Usage

const Recipe = require('@mr_fozan/recipe.js');

const recipes = [
    {
        id: "juice",
        name: "Juice",
        ingridients: [
            {
                id: "apple",
                name: "Apple",
                count: 5
            }
        ]
    }
];

const recipe = new Recipe(recipes);

๐Ÿ“‹ Get a list of recipes

const Recipe = require('@mr_fozan/recipe.js');
const recipe = new Recipe(recipes);

console.log(recipe.list());

๐Ÿงพ Get a specific recipe

const Recipe = require('@mr_fozan/recipe.js');
const recipe = new Recipe(recipes);

console.log(recipe.get("juice"));

๐Ÿ Get a ingridients recipe

const Recipe = require('@mr_fozan/recipe.js');
const Recipes = new Recipe(recipes);

console.log(Recipes.getIngridients("juce", 5).ingridients);

โš’ Craft recipe

const Recipe = require('@mr_fozan/recipe.js');
const recipe = new Recipe({ recipes, debug: true });

const inventory = [
    {
        id: "apple",
        count: 5
    }
];

const craft = recipe.craft("juice", invenory);

console.log(craft); // true

If the result is true, then the craft is successful. If the result is false, then crafting is unsuccessful.

๐Ÿ‘ฅ Contributors

License

The MIT License (MIT)

1.0.2

4 months ago

1.0.1

4 months ago

1.0.3

4 months ago

1.0.0

4 months ago