Sass é uma linguagem de script que é interpretada ou compilada em Cascading Style Sheets (CSS). e neste GIST estarei demonstrando como usar sass com node js.
Iniciar um projecto do zero com a framework express
mkdir node_sass
class ProcessarPagamento { | |
private bulk: number; | |
private empresa: number; | |
private totalToPay: number; | |
private moeda: string; | |
constructor(bulk: number, empresa: number, totalToPay: number, moeda: string) { | |
this.bulk = bulk; | |
this.empresa = empresa; | |
this.totalToPay = totalToPay; |
'use strict'; | |
const Factory = use('Factory'); | |
const { test, trait } = use('Test/Suite')('Thread'); | |
const Thread = use('App/Models/Thread'); | |
trait('Auth/Client'); | |
trait('Test/ApiClient'); | |
trait('DatabaseTransactions'); |
version: '3.7' | |
services: | |
elasticsearch: | |
image: elasticsearch:7.9.2 | |
ports: | |
- '9200:9200' | |
environment: | |
- discovery.type=single-node | |
ulimits: |
const unix_timestamp = 610329600000; | |
const date = new Date(unix_timestamp); | |
const calculate_age = (dob) => { | |
const diff_ms = Date.now() - dob.getTime(); | |
const age_dt = new Date(diff_ms); | |
return Math.abs(age_dt.getUTCFullYear() - 1970); | |
}; | |
router.route('/fetchdata').get(function(req,res){ | |
employees.find( {{"age" : {$gt : 25}}, function(err, result){ | |
if(err){ | |
res.send(err) | |
} | |
else{ | |
function print3largest(array, size){ | |
let i, first, second, third; | |
if(size < 3){ | |
throw new Error("Invalid Input"); | |
return; | |
} | |
third = first = second = Number.MIN_VALUE; | |
for(i =0; i < size; i++){ | |
// If current element is greater than frist |
pageSchema.statics.findOneOrCreate = function findOneOrCreate(condition, doc, callback) { | |
const self = this; | |
self.findOne(condition, (err, result) => { | |
return result | |
? callback(err, result) | |
: self.create(doc, (err, result) => { | |
return callback(err, result); | |
}); | |
}); |
Este passo a passo assume que já tenhas o lekto instalado caso contrario podes instalar o lektor seguindo a documentação neste link