diff --git a/index.mjs b/index.mjs old mode 100644 new mode 100755 index c2f3897..7c02aa1 --- a/index.mjs +++ b/index.mjs @@ -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))); \ No newline at end of file + .then((data) => getFood(data).map((food) => console.log(food))); diff --git a/package-lock.json b/package-lock.json index 3b1cc58..7a649b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { diff --git a/package.json b/package.json index 1a7358b..009bf67 100644 --- a/package.json +++ b/package.json @@ -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",