Skip to content

Instantly share code, notes, and snippets.

View geshan's full-sized avatar

Geshan Manandhar geshan

View GitHub Profile
@geshan
geshan / Markdium-Shell.bash
Created March 17, 2021 03:02
Markdium-How to use nodemon to restart your Node.js applications automatically and efficiently
npm install --save-dev nodemon
@geshan
geshan / Markdium-JavaScript.js
Created March 17, 2021 03:02
Markdium-How to use nodemon to restart your Node.js applications automatically and efficiently
{
"events": {
"start": "clear"
},
"delay": "2500"
}
@geshan
geshan / Markdium-JavaScript.js
Created March 17, 2021 03:02
Markdium-How to use nodemon to restart your Node.js applications automatically and efficiently
"scripts": {
"start": "node ./bin/www",
"start:dev": "DEBUG=nodejs-mysql:* nodemon ./bin/www"
},
@geshan
geshan / Markdium-Shell.bash
Created March 17, 2021 03:02
Markdium-How to use nodemon to restart your Node.js applications automatically and efficiently
nodemon delay 2 index.js
@geshan
geshan / Markdium-Shell.bash
Created March 17, 2021 03:02
Markdium-How to use nodemon to restart your Node.js applications automatically and efficiently
npm install -g nodemon
@geshan
geshan / Markdium-Shell.bash
Created March 17, 2021 03:02
Markdium-How to use nodemon to restart your Node.js applications automatically and efficiently
nodemon -e js,sql index.js
@geshan
geshan / Markdium-Shell.bash
Created March 14, 2021 04:29
Markdium-5 Node.js Logging libraries compared for you to make the optimal choice
Example app listening at http://localhost:3004
Loglevel is simple
@geshan
geshan / Markdium-Shell.bash
Created March 14, 2021 04:29
Markdium-5 Node.js Logging libraries compared for you to make the optimal choice
Example app listening at http://localhost:3003
{"level":30,"time":1611695678813,"pid":32768,"hostname":"abcd","req":{"id":1,"method":"GET","url":"/api/test","headers":{"host":"localhost:3003","connection":"keep-alive","sec-ch-ua":"\"Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"","sec-ch-ua-mobile":"?0","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-fetch-site":"none","sec-fetch-mode":"navigate","sec-fetch-user":"?1","sec-fetch-dest":"document","accept-encoding":"gzip, deflate, br","accept-language":"en-GB,en-US;q=0.9,en;q=0.8","cookie":"_ga=GA1.1.1863215728.1591927460; PPA_ID=gkq1qhp7htr141pkojpmqcqt95; webfx-tree-cookie-persistence=wfxt-4; io=TxK-RQvnHb14VONKAAAC","if-none-match":"W/\"19-JzA5ewGlTSyvFTwS4fIYMkA
@geshan
geshan / Markdium-Shell.bash
Created March 14, 2021 04:29
Markdium-5 Node.js Logging libraries compared for you to make the optimal choice
Example app listening at http://localhost:3001
{"meta":{},"level":"\u001b[32minfo\u001b[39m","message":"GET /api/test 304 2ms"}
{"meta":{},"level":"\u001b[32minfo\u001b[39m","message":"GET /favicon.ico 404 2ms"}
{"meta":{},"level":"\u001b[32minfo\u001b[39m","message":"GET /favicon.ico 404 1ms"}
@geshan
geshan / Markdium-JavaScript.js
Created March 14, 2021 04:29
Markdium-5 Node.js Logging libraries compared for you to make the optimal choice
const winston = require('winston');
const expressWinston = require('express-winston');
const express = require('express');
const app = express();
const port = 3001;
//more options here - https://github.com/bithavoc/express-winston#request-logging
app.use(expressWinston.logger({
transports: [
new winston.transports.Console()