cooking-temperature 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Luc Atangana
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # cooking-temperature
2
+
3
+ A comprehensive library for safe cooking temperatures, doneness levels, and cooking instructions for various ingredients.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install cooking-temperature
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import {
15
+ findByName,
16
+ getQuickReference,
17
+ getSafeMinimumTemp,
18
+ getDonenessTemp,
19
+ getCookingInstruction,
20
+ convertTemperature,
21
+ } from "cooking-temperature"
22
+
23
+ // Quick reference lookup
24
+ const chicken = getQuickReference("chicken breast", "oven_bake")
25
+ // Returns: { name, safeMinimumTemp, tempUnit, restMinutes, suggestedMethod, visualIndicators }
26
+
27
+ // Find an ingredient by name or alias
28
+ const beef = findByName("ribeye")
29
+
30
+ // Get safe minimum temperature
31
+ const safeTemp = getSafeMinimumTemp("chicken-breast", "F")
32
+ // Returns: { temp: 165, restMinutes: 0 }
33
+
34
+ // Get doneness temperature for proteins
35
+ const mediumRare = getDonenessTemp("beef-ribeye", "medium_rare", "F")
36
+ // Returns: 135
37
+
38
+ // Get cooking instructions
39
+ const instructions = getCookingInstruction("salmon-fillet", "oven_bake")
40
+ // Returns: { applianceTemp, applianceTempUnit, timeMinutes, notes, portionDescription }
41
+
42
+ // Convert between Fahrenheit and Celsius
43
+ const celsius = convertTemperature(165, "F", "C")
44
+ // Returns: 74
45
+ ```
46
+
47
+ ## API
48
+
49
+ ### Lookup Functions
50
+
51
+ - `findByName(query)` - Find an ingredient by name or alias
52
+ - `findById(id)` - Find an ingredient by its unique ID
53
+ - `findByCategory(category)` - Get all ingredients in a category
54
+ - `getAllEntries()` - Get all cooking temperature entries
55
+ - `getAllCategories()` - Get all available categories
56
+
57
+ ### Temperature Functions
58
+
59
+ - `convertTemperature(temp, from, to)` - Convert between Fahrenheit and Celsius
60
+ - `getSafeMinimumTemp(ingredientId, unit?)` - Get USDA safe minimum temperature
61
+ - `getDonenessTemp(ingredientId, doneness, unit?)` - Get temperature for a specific doneness level
62
+
63
+ ### Cooking Instructions
64
+
65
+ - `getCookingMethods(ingredientId)` - Get available cooking methods for an ingredient
66
+ - `getCookingInstruction(ingredientId, method, portionHint?)` - Get detailed cooking instructions
67
+ - `getQuickReference(query, method?, unit?)` - Get a quick reference with all relevant info
68
+
69
+ ## Categories
70
+
71
+ - `poultry` - Chicken, turkey, duck
72
+ - `beef` - Steaks, roasts, ground beef
73
+ - `pork` - Chops, tenderloin, ribs
74
+ - `seafood_fish` - Salmon, tuna, cod
75
+ - `seafood_shellfish` - Shrimp, lobster, scallops
76
+ - `egg` - Various egg preparations
77
+ - `vegetable` - Common vegetables
78
+ - `grain` - Rice, pasta, quinoa
79
+
80
+ ## Doneness Levels
81
+
82
+ For proteins that support doneness preferences:
83
+
84
+ - `rare`
85
+ - `medium_rare`
86
+ - `medium`
87
+ - `medium_well`
88
+ - `well_done`
89
+ - `safe_minimum` (USDA baseline)
90
+
91
+ ## Cooking Methods
92
+
93
+ - `oven_roast`, `oven_bake`
94
+ - `pan_sear`, `pan_fry`
95
+ - `grill`, `broil`
96
+ - `poach`, `simmer`, `boil`, `steam`
97
+ - `sous_vide`
98
+ - `air_fry`, `deep_fry`
99
+ - `slow_cook`
100
+
101
+ ## License
102
+
103
+ MIT
@@ -0,0 +1,77 @@
1
+ type TemperatureUnit = "F" | "C";
2
+ type CookingMethod = "oven_roast" | "oven_bake" | "pan_sear" | "pan_fry" | "grill" | "broil" | "poach" | "simmer" | "boil" | "steam" | "sous_vide" | "air_fry" | "deep_fry" | "slow_cook";
3
+ type DonenessLevel = "rare" | "medium_rare" | "medium" | "medium_well" | "well_done" | "safe_minimum";
4
+ type IngredientCategory = "poultry" | "beef" | "pork" | "lamb" | "seafood_fish" | "seafood_shellfish" | "egg" | "vegetable" | "grain" | "legume";
5
+ interface CookingInstruction {
6
+ method: CookingMethod;
7
+ applianceTemp: number;
8
+ applianceTempUnit: TemperatureUnit;
9
+ timeMinutes: {
10
+ min: number;
11
+ max: number;
12
+ };
13
+ notes?: string;
14
+ }
15
+ interface DonenessSpec {
16
+ level: DonenessLevel;
17
+ internalTemp: number;
18
+ internalTempUnit: TemperatureUnit;
19
+ description: string;
20
+ }
21
+ interface CookingTemperatureEntry {
22
+ id: string;
23
+ name: string;
24
+ category: IngredientCategory;
25
+ aliases: string[];
26
+ safeMinimumTemp: number;
27
+ safeMinimumTempUnit: TemperatureUnit;
28
+ restTimeMinutes?: number;
29
+ donenessLevels?: DonenessSpec[];
30
+ cookingInstructions: {
31
+ portionDescription: string;
32
+ methods: CookingInstruction[];
33
+ }[];
34
+ visualIndicators?: string[];
35
+ sources: string[];
36
+ }
37
+
38
+ declare const findByName: (query: string) => CookingTemperatureEntry | undefined;
39
+ declare const findById: (id: string) => CookingTemperatureEntry | undefined;
40
+ declare const findByCategory: (category: IngredientCategory) => CookingTemperatureEntry[];
41
+ declare const getAllEntries: () => CookingTemperatureEntry[];
42
+ declare const getAllCategories: () => IngredientCategory[];
43
+ declare const convertTemperature: (temp: number, from: TemperatureUnit, to: TemperatureUnit) => number;
44
+ declare const getSafeMinimumTemp: (ingredientId: string, unit?: TemperatureUnit) => {
45
+ temp: number;
46
+ restMinutes: number;
47
+ } | undefined;
48
+ declare const getDonenessTemp: (ingredientId: string, doneness: DonenessLevel, unit?: TemperatureUnit) => number | undefined;
49
+ declare const getCookingMethods: (ingredientId: string) => CookingMethod[];
50
+ declare const getCookingInstruction: (ingredientId: string, method: CookingMethod, portionHint?: string) => {
51
+ applianceTemp: number;
52
+ applianceTempUnit: TemperatureUnit;
53
+ timeMinutes: {
54
+ min: number;
55
+ max: number;
56
+ };
57
+ notes?: string;
58
+ portionDescription: string;
59
+ } | undefined;
60
+ declare const getQuickReference: (query: string, method?: CookingMethod, unit?: TemperatureUnit) => {
61
+ name: string;
62
+ safeMinimumTemp: number;
63
+ tempUnit: TemperatureUnit;
64
+ restMinutes: number;
65
+ suggestedMethod?: {
66
+ method: CookingMethod;
67
+ applianceTemp: number;
68
+ timeMinutes: {
69
+ min: number;
70
+ max: number;
71
+ };
72
+ notes?: string;
73
+ };
74
+ visualIndicators: string[];
75
+ } | undefined;
76
+
77
+ export { type CookingInstruction, type CookingMethod, type CookingTemperatureEntry, type DonenessLevel, type DonenessSpec, type IngredientCategory, type TemperatureUnit, convertTemperature, findByCategory, findById, findByName, getAllCategories, getAllEntries, getCookingInstruction, getCookingMethods, getDonenessTemp, getQuickReference, getSafeMinimumTemp };
@@ -0,0 +1,77 @@
1
+ type TemperatureUnit = "F" | "C";
2
+ type CookingMethod = "oven_roast" | "oven_bake" | "pan_sear" | "pan_fry" | "grill" | "broil" | "poach" | "simmer" | "boil" | "steam" | "sous_vide" | "air_fry" | "deep_fry" | "slow_cook";
3
+ type DonenessLevel = "rare" | "medium_rare" | "medium" | "medium_well" | "well_done" | "safe_minimum";
4
+ type IngredientCategory = "poultry" | "beef" | "pork" | "lamb" | "seafood_fish" | "seafood_shellfish" | "egg" | "vegetable" | "grain" | "legume";
5
+ interface CookingInstruction {
6
+ method: CookingMethod;
7
+ applianceTemp: number;
8
+ applianceTempUnit: TemperatureUnit;
9
+ timeMinutes: {
10
+ min: number;
11
+ max: number;
12
+ };
13
+ notes?: string;
14
+ }
15
+ interface DonenessSpec {
16
+ level: DonenessLevel;
17
+ internalTemp: number;
18
+ internalTempUnit: TemperatureUnit;
19
+ description: string;
20
+ }
21
+ interface CookingTemperatureEntry {
22
+ id: string;
23
+ name: string;
24
+ category: IngredientCategory;
25
+ aliases: string[];
26
+ safeMinimumTemp: number;
27
+ safeMinimumTempUnit: TemperatureUnit;
28
+ restTimeMinutes?: number;
29
+ donenessLevels?: DonenessSpec[];
30
+ cookingInstructions: {
31
+ portionDescription: string;
32
+ methods: CookingInstruction[];
33
+ }[];
34
+ visualIndicators?: string[];
35
+ sources: string[];
36
+ }
37
+
38
+ declare const findByName: (query: string) => CookingTemperatureEntry | undefined;
39
+ declare const findById: (id: string) => CookingTemperatureEntry | undefined;
40
+ declare const findByCategory: (category: IngredientCategory) => CookingTemperatureEntry[];
41
+ declare const getAllEntries: () => CookingTemperatureEntry[];
42
+ declare const getAllCategories: () => IngredientCategory[];
43
+ declare const convertTemperature: (temp: number, from: TemperatureUnit, to: TemperatureUnit) => number;
44
+ declare const getSafeMinimumTemp: (ingredientId: string, unit?: TemperatureUnit) => {
45
+ temp: number;
46
+ restMinutes: number;
47
+ } | undefined;
48
+ declare const getDonenessTemp: (ingredientId: string, doneness: DonenessLevel, unit?: TemperatureUnit) => number | undefined;
49
+ declare const getCookingMethods: (ingredientId: string) => CookingMethod[];
50
+ declare const getCookingInstruction: (ingredientId: string, method: CookingMethod, portionHint?: string) => {
51
+ applianceTemp: number;
52
+ applianceTempUnit: TemperatureUnit;
53
+ timeMinutes: {
54
+ min: number;
55
+ max: number;
56
+ };
57
+ notes?: string;
58
+ portionDescription: string;
59
+ } | undefined;
60
+ declare const getQuickReference: (query: string, method?: CookingMethod, unit?: TemperatureUnit) => {
61
+ name: string;
62
+ safeMinimumTemp: number;
63
+ tempUnit: TemperatureUnit;
64
+ restMinutes: number;
65
+ suggestedMethod?: {
66
+ method: CookingMethod;
67
+ applianceTemp: number;
68
+ timeMinutes: {
69
+ min: number;
70
+ max: number;
71
+ };
72
+ notes?: string;
73
+ };
74
+ visualIndicators: string[];
75
+ } | undefined;
76
+
77
+ export { type CookingInstruction, type CookingMethod, type CookingTemperatureEntry, type DonenessLevel, type DonenessSpec, type IngredientCategory, type TemperatureUnit, convertTemperature, findByCategory, findById, findByName, getAllCategories, getAllEntries, getCookingInstruction, getCookingMethods, getDonenessTemp, getQuickReference, getSafeMinimumTemp };