@jclind/ingredient-parser 1.0.1 → 1.0.3

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.
Files changed (3) hide show
  1. package/index.js +15 -3
  2. package/package.json +1 -1
  3. package/http-common.ts +0 -16
package/index.js CHANGED
@@ -1,7 +1,19 @@
1
- const { mongoHttp, spoonacularHttp } = require('./http-common.ts')
2
- const dotenv = require('dotenv')
3
- dotenv.config()
4
1
  const { parse } = require('recipe-ingredient-parser-v3')
2
+ const axios = require('axios')
3
+
4
+ const mongoHttp = axios.create({
5
+ baseURL:
6
+ 'https://us-east-1.aws.data.mongodb-api.com/app/prepify-ixumn/endpoint',
7
+ headers: {
8
+ 'Content-type': 'application/json',
9
+ },
10
+ })
11
+ const spoonacularHttp = axios.create({
12
+ baseURL: 'https://api.spoonacular.com/food/ingredients/',
13
+ headers: {
14
+ 'Content-type': 'application/json',
15
+ },
16
+ })
5
17
 
6
18
  const ingredientParser = async (ingrString, spoonacularAPIKey) => {
7
19
  const parsedIngr = parse(ingrString, 'eng')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jclind/ingredient-parser",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Parses given sentence including ingredient information and attemps to return quantity, measurement and ingredient",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/http-common.ts DELETED
@@ -1,16 +0,0 @@
1
- const axios = require('axios')
2
-
3
- const mongoHttp = axios.create({
4
- baseURL:
5
- 'https://us-east-1.aws.data.mongodb-api.com/app/prepify-ixumn/endpoint',
6
- headers: {
7
- 'Content-type': 'application/json',
8
- },
9
- })
10
- const spoonacularHttp = axios.create({
11
- baseURL: 'https://api.spoonacular.com/food/ingredients/',
12
- headers: {
13
- 'Content-type': 'application/json',
14
- },
15
- })
16
- module.exports = { mongoHttp, spoonacularHttp }