Created
October 4, 2016 15:56
-
-
Save edinsoncs/8069699491ed8871a2327bc4f5dd7c61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
//Basic Nodejs | |
const fs = require('fs'); | |
const actuality = __dirname; | |
const actualityFile = __filename; | |
//Basic nodejs __dirname => en que carpeta estoy parado | |
console.log('Estoy parado en esta ruta: ' +actuality); | |
console.log('Estoy parado en esta ruta mas el archivo que ejecute: ' + actualityFile); | |
console.log('########################################################################'); | |
console.log('Process es un objecto global informa y tiene el control y procesos de nodejs, son instancias de eventos'); | |
process.on('exit', (code) => { | |
console.log('return: ' + code); | |
}); | |
console.log('########################################################################'); | |
const unhandledRejections = new Map(); | |
process.on('unhandledRejection', (reason, p) => { | |
console.log('hola'); | |
unhandledRejections.set(p, reason); | |
}); | |
process.on('rejectionHandled', (p) => { | |
unhandleRejections.delete(p); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment