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
//Diffrent way to generate password in Nodejs | |
// 1 | |
var CryptoJS = require("crypto-js"); | |
var text = 'sagar'; | |
var password = 'sagar'; | |
var encrypted = CryptoJS.AES.encrypt(text, password); | |
encrypted = encrypted.toString(); | |
console.log('@encrypted ' + encrypted); |
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
class Animal{ | |
constructor(name , height){ | |
this.name = name; | |
this.height = height; | |
} | |
Hello(){ | |
console.log("Hello from Animal"); | |
} | |
} |
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
//If you create the static methods in classes, then you call static methods without creating the class instances. | |
class Tasks{ | |
static Addition(a , b){ | |
return a+b; | |
} | |
static Subtraction(a , b){ | |
return a-b; | |
} |
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
var Cryptr = require('cryptr'), | |
cryptr = new Cryptr('secretKey'); | |
var encryptedString = cryptr.encrypt('sagar'), | |
decryptedString = cryptr.decrypt(encryptedString); | |
console.log(encryptedString); // 0ed11b7de924ff2a81260fb5d44a954c | |
console.log(decryptedString); // sagar |
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
var nodemailer = require('nodemailer'); | |
//send mail using nodemailer via gmail service | |
var transporter = nodemailer.createTransport({ | |
service: 'gmail', | |
auth: { | |
user: 'yourEmail', | |
pass: 'yourPassword' | |
} | |
}); |
NewerOlder