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
| import React from 'react' | |
| export default class JsonToCsv extends React.Component{ | |
| // função que faz Download do Arquivo .csv | |
| download(data){ | |
| const blob = new Blob([data], {type: 'text/csv'}) | |
| // console.log(blob) | |
| const url = URL.createObjectURL(blob) | |
| const a = document.createElement('a') | |
| a.setAttribute('hidden', '') |
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
| 0 info it worked if it ends with ok | |
| 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i', '--save', 'node-sass' ] | |
| 2 info using npm@6.9.0 | |
| 3 info using node@v11.13.0 | |
| 4 verbose npm-session 1e7ad1293dfec754 | |
| 5 silly install loadCurrentTree | |
| 6 silly install readLocalPackageData | |
| 7 http fetch GET 200 https://registry.npmjs.org/node-sass 25ms (from cache) | |
| 8 silly pacote tag manifest for node-sass@latest fetched in 39ms | |
| 9 timing stage:loadCurrentTree Completed in 5013ms |
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 axios = require('axios'); | |
| module.exports.getDadosMonit = async (idMonitoramento, xtoken, validate, idDominio) => | |
| await axios.all([ | |
| axios({ | |
| method: 'post', | |
| url: 'https://api.smgeo.com.br/', | |
| data: { | |
| sessao: 'monitoramento_socioambiental', | |
| acao: 'listar', | |
| dados: { |
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
| https://tecadmin.net/install-latest-nodejs-npm-on-debian/ |
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 newArrayFromNumber = length => Array.from({ length }) | |
| const range = (max, min = 0) => { | |
| const length = max - min | |
| return newArrayFromNumber(length) | |
| .map((_, index) => ({ number: index + min })) | |
| } | |
| const arr = range(25, 5) |
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
| // array | |
| const result = [{ | |
| "id":1, | |
| "item":8, | |
| "dados":[ | |
| { | |
| "valor":"valor1" | |
| }, | |
| { | |
| "valor":"valor2" |
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 anotherFucntion = async function(){ | |
| for(const iterable of arrayDeRequests){ | |
| await requestHere | |
| } | |
| } |
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
| //gera array de acordo com o nmero passando no parametro da função newArrayFromNumber(10) | |
| const newArrayFromNumber = length => Array.from({ length }) | |
| // gera um array ex: const arr = [{numero:1}, {numero:2}...] | |
| const arr = newArrayFromNumber(10) | |
| .map((_, index) => ({ numeroGta: index + 1, serieGta:'J'})) | |
| console.log(arr) |
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 data = [ | |
| { | |
| "idLote": 46, | |
| "nfs": "01", | |
| "data_lote_nfs": "2019-03-02T03:00:00.000Z", | |
| "unidade": "Unidade Teste", | |
| "grupo": "Walmart", | |
| "nome_dominio": "FRIGOL", | |
| "dominio": 11, | |
| "idUnidade": 30 |
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
| function1() return ([{ | |
| "info1": "teste", | |
| "info2": "teste", | |
| "info3":"teste" | |
| "idLote": 50 | |
| }, | |
| { | |
| "info1": "teste", |