Added start and bin script

This commit is contained in:
Joonas 2022-11-08 16:47:18 +02:00
parent 07877a0da9
commit 950b2ad97c
3 changed files with 13 additions and 6 deletions

4
index.mjs Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/usr/bin/env node
import fetch from "node-fetch";
const APIURI = "https://fi.jamix.cloud/apps/menuservice/rest/haku/menu/92225/1?lang=fi"
var todayDate = new Date().toISOString().slice(0, 10).replaceAll('-', '');
@ -20,4 +22,4 @@ function getFood(data) {
fetch(APIURI)
.then((response) => response.json())
.then((data) => getFood(data).map((food) => console.log(food)));
.then((data) => getFood(data).map((food) => console.log(food)));

7
package-lock.json generated
View File

@ -1,15 +1,18 @@
{
"name": "faicli",
"name": "faifood",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "faicli",
"name": "faifood",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"node-fetch": "^3.2.10"
},
"bin": {
"faifood": "index.mjs"
}
},
"node_modules/data-uri-to-buffer": {

View File

@ -1,12 +1,14 @@
{
"name": "faicli",
"name": "faifood",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"run": "node index.js"
"start": "node index.mjs"
},
"bin": {
"faifood": "index.mjs"
},
"keywords": [],
"author": "",
"license": "ISC",