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
| /** | |
| Let say I have a fancy class with some fancy methods in services|helpers | |
| withoud any sails logic in it, eg no waterline, no sails.*.*.js | |
| */ | |
| class FancyService { | |
| async fancyMethod() { | |
| return await Promise.resolve('Fancy Result') | |
| } | |
| } |
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
| const winston = require('winston') | |
| const customLogger = new (winston.Logger)({ | |
| transports: [ | |
| new (winston.transports.Console)({ | |
| colorize: true, | |
| level: 'silly', | |
| json: false | |
| }), | |
| new (winston.transports.File)({ // add as many as you want | |
| name: 'verbose-file', |
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
| // importamos la libreria | |
| const fs = require('fs'); | |
| //puede llevar cualquier nombre, generalmente | |
| // se sigue la convencion de usar el mismo nombre que la libreria | |
| // fs es parte de la libreria estandard | |
| /** | |
| * @param {string} directorio de destino | |
| * @param {string} texto a escribir dentro del archivo |
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
| // importamos la libreria | |
| const fs = require('fs'); | |
| //puede llevar cualquier nombre, generalmente | |
| // se sigue la convencion de usar el mismo nombre que la libreria | |
| // fs es parte de la libreria estandard | |
| /** | |
| * @param {string} directorio de destino | |
| * @param {string} texto a escribir dentro del archivo |
NewerOlder