daily pastebin goal
51%
SHARE
TWEET

formattedOutput.js

a guest May 17th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var date = new Date();
  2.  
  3. module.exports.printDate = () => {
  4.     console.log('printing current time.')
  5.     console.log(`current time: ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`);
  6. };
  7.  
  8. module.exports.getFormattedTime = () => {
  9.     return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
  10. };
  11.  
  12. module.exports.printDefault = (message) => {
  13.     console.log(`[${this.getFormattedTime()}]: ${message}`)
  14. };
  15.  
  16. module.exports.printImportant = (message) => {
  17.     console.log('\x1b[41m', `[${this.getFormattedTime()}]: ${message}`)
  18. };
RAW Paste Data
Top