This file contains 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
var Excel = require('exceljs'); | |
var workbook = new Excel.Workbook(); | |
workbook.xlsx.readFile('../../storage/cust_88ae31d4-47c5-4f70-980e-7b473ba20ef9/xls.xls') | |
.then(function() { | |
var worksheet = workbook.getWorksheet('Sheet1'); | |
worksheet.eachRow({ includeEmpty: true }, function(row, rowNumber) { | |
console.log("Row " + rowNumber + " = " + JSON.stringify(row.values)); | |
}); | |
}); |
This file contains 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
For setting proxy: | |
npm config set strict-ssl false | |
npm config set registry http://registry.npmjs.org/ | |
npm config set https-proxy http://un:pw@proxyadd:port/ | |
npm config set proxy http://un:pw@proxyadd:port/ | |
For removing proxy: | |
npm config rm proxy |
This file contains 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
var request = require('request'); | |
var r = request.defaults({'proxy':'http://192.168.1.1:3128'}); | |
r('http://www.google.com', function (error, response, body) { | |
console.log('error:', error); // Print the error if one occurred | |
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received | |
console.log('body:', body); // Print the HTML for the Google homepage. | |
}); |
This file contains 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
function resolveAfter2Seconds(x) { | |
return new Promise(resolve => { | |
//resolve(x) | |
}); | |
} | |
async function f1() { | |
var x = await resolveAfter2Seconds(10); | |
console.log(x); // 10 | |
} |
This file contains 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
<html> | |
<head> | |
<title>File upload Node.</title> | |
</head> | |
<body> | |
<form id="uploadForm" enctype="multipart/form-data" action="/api/photo" method="post"> | |
<input type="file" name="userPhoto" multiple accept=".xlsx,.xlx,.csv"/> | |
<input type="submit" value="Upload Image" name="submit"> | |
<!-- <input type='text' id='random' name='random'><br> --> | |
<span id = "status"></span> |
This file contains 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
var express = require('express'); | |
var app = express(); | |
var bodyParser = require('body-parser'); | |
var mysql = require('mysql'); | |
var con = mysql.createConnection({ | |
host:"localhost", | |
user:"root", | |
passsword:"sree", | |
database:"emp" | |
}); |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>AJAX/Express Example</title> | |
</head> | |
<body> | |
<form id="signup" method="POST" action="/addUser"> | |
<div> | |
<label for="name">Name</label> | |
<input name="name"type="text" id="name" /> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Upload File</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
</head> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Simple Multer Upload Example</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<form action="/" enctype="multipart/form-data" method="post"> | |
<input type="file" name="file-to-upload"> |
This file contains 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
var cluster = require('cluster'); | |
var count = 0; | |
function *sendRequest(){ | |
for (var i=0; i<10000; i++) { | |
count++; | |
yield i; | |
if(count == 10){ | |
process.exit(0); | |
} | |
} |
NewerOlder