Random Password Generator in Node.JS

The other day I thought about how to generate passwords from random arrays. Here is what I came up with: /* * RaNdom Password Generator */ const crypto = require(‘crypto’); const PASSWORD_LENGTH = 18; const LOWERCASE_ALPHABET = ‘abcdefghijklmnopqrstuvwxyz’; // 26 chars const UPPERCASE_ALPHABET = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’; // 26 chars const NUMBERS = ‘0123456789’; // 10 chars const SYMBOLS = ‘,./<>?;\'”:[]\\|}{=-_+`~!@#$%^&*()’; // …

How to parse JSON files in Node.JS ?

Quick tip using fs: let data = fs.readFileSync(“myFile.json”, ‘utf8’); console.log(typeof JSON.parse(data)); There is another way to do this that requires less effort. Using require directly, like so: const data = require(“myFile.json”); console.log(typeof data); Or you can create a function like this with fs also: function loadAlgorithms(fName) { let data = fs.readFileSync(fName, ‘utf8’); return JSON.parse(data); } Hope it helps.

How to create a Node.JS application with Express Generator

I am assuming that you already have Node.JS installed. If you don’t, worry not! you can get your own copy today from the Node.JS download section! Using ExpressJS is very quick and easy. It generates all the file structure needed for a web application. You can select¬† any of the different views they have available, in this case I am …