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
console.log('Starting password manager.'); | |
var storage = require('node-persist'); // integrates node-persist module into this application | |
storage.initSync(); // prepares the computer to write and save variables | |
var argv = require('yargs') | |
.command('create', 'Creates a user account', function(yargs){ | |
yargs.options({ | |
name: { | |
demand: true, |
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
/* This file simulates how to access a native json file*/ | |
var output = document.getElementById('output'); | |
var ajaxhttp = new XMLHttpRequest(); // creates a js object with required functiionality | |
var url = "json.json"; // the exteranal json file | |
ajaxhttp.open("GET", url, true); // access the json file | |
ajaxhttp.setRequestHeader("content-type", "application/json"); // value sent over to the server, indicating | |
// what type of content the browser expects to receive | |
/* |
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> | |
<meta charset="utf-8" /> | |
<title>Example JSON Discoveryvip</title> | |
<meta name="description" content"Discoveryvip.com> | |
<link href="style.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> |
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
/* This file simulates how to access a native json file*/ | |
var output = document.getElementById('output'); | |
var ajaxhttp = new XMLHttpRequest(); // creates a js object with required functiionality | |
var url = "json.json"; // the exteranal json file | |
ajaxhttp.open("GET", url, true); // access the json file | |
ajaxhttp.setRequestHeader("content-type", "application/json"); // value sent over to the server, indicating | |
// what type of content the browser expects to receive | |
/* |
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
console.log('Starting password manager.'); | |
var storage = require('node-persist'); // integrates node-persist module into this application | |
storage.initSync(); // prepares the computer to write and save variables | |
// Encryption/Decryption part | |
var crypto = require('crypto-js'); | |
var secretKey = "abc"; | |
var masterPassword = "123"; |
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
console.log('Starting password manager.'); | |
var crypto = require('crypto-js'); | |
var storage = require('node-persist'); // integrates node-persist module into this application | |
storage.initSync(); // prepares the computer to write and save variables | |
/* | |
var retrievedAccount = storage.getItemSync('account'); | |
console.log("Account is ", retrievedAccount); | |
*/ |
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 doWork(){ | |
// throw an error that says unable to work | |
console.log("Unable to work!"); | |
} | |
try { | |
// call doWork() | |
throw new Error(doWork()); | |
} catch (e) { | |
console.log(e.message); |
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
/* | |
The example provided had a 'throw new Error' statement in the try section | |
see below | |
*/ | |
try { | |
throw new Error('Unable to do the thing you wanted'); | |
} catch(e){ | |
console.log(e.message); | |
} finally { |
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> | |
<meta charset="utf-8" /> | |
<title>Example JSON Discoveryvip</title> | |
<meta name="description" content"Discoveryvip.com> | |
<link href="style.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> |
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
{ | |
"firstName": "Henry", | |
"lastName": "Lawson", | |
"isAlive": true, | |
"age": 25, | |
"address": { | |
"streetAddress": "21 2nd Street", | |
"city": "New York", | |
"state": "NY", | |
"postalCode": "10021-3100" |
OlderNewer