Saturday, 6 February 2021

Saturday, 27 June 2020

Mastering Node.js

Menjalankan Aplikasi NodeJS di Background


Untuk menjalana aplikasi nodejs di bacground kita dapat menggunakan pm2 [3]

sudo npm install pm2@latest -g
cd /path/to/project
pm2 start --name="Project Name" npm -- start

Referensi

  1. Node.js Crash Course Tutorial, https://www.youtube.com/playlist?list=PL4cUxeGkcC9jsz4LDYc6kv3ymONOKxwBU
  2. How to Manage Multiple Node Versions in MacOS. (2021 Guide), https://chamikakasun.medium.com/how-to-manage-multiple-node-versions-in-macos-2021-guide-5065f32cb63b
  3. PM2, advanced, production process manager for NodeJS, https://pm2.keymetrics.io
  4. How to Run a Npm Start Script With PM2, https://coderrocketfuel.com/article/how-to-run-a-npm-start-script-with-pm2

Wednesday, 29 April 2020

Set a default parameter value for a JavaScript function

From ES6/ES2015, default parameters are in the language specification.
function read_file(file, delete_after = false) { // Code }

// the `= {}` below lets you call the function without any parameters 
function myFor({
 start = 5,
 end = 1,
 step = -1
} = {}) { // (A) // Use the variables `start`, `end` and `step` here ··· }

Pre ES2015,

function foo(a, b) {
 a = typeof a !== 'undefined' ? a : 42;
 b = typeof b !== 'undefined' ? b : 'default_b';...
}

Referensi

  1. Set a default parameter value for a JavaScript function, https://stackoverflow.com/questions/894860/set-a-default-parameter-value-for-a-javascript-function

Saturday, 21 December 2019

Date Range Picker

A JavaScript component for choosing date ranges, dates and times.

Referensi


  1. Date Range Picker, https://www.daterangepicker.com

Moment.js

Parse, validate, manipulate, and display dates and times in JavaScript.

Referensi


  1. Moment.js, https://momentjs.com/

Saturday, 16 November 2019

Chart.js

...

Referensi


  1. Chart.js. Simple yet flexible JavaScript charting for designers & developers, https://www.chartjs.org/
  2. Chart.js: Is it possible to get the label of a dataset in a stacked bargraph on clicking it?, https://stackoverflow.com/questions/44408670/chart-js-is-it-possible-to-get-the-label-of-a-dataset-in-a-stacked-bargraph-on

Tuesday, 22 January 2019

Bersahabat dengan Gulp

Status : Draft

Referensi


  1. Glup, Automate and enhance your workflow, https://gulpjs.com/
  2. A quick guide for switching to gulp 4, https://codeburst.io/switching-to-gulp-4-0-271ae63530c0