├── FS └── app.js ├── yargs ├── .gitignore ├── playground │ ├── notes.json │ ├── debugging.js │ ├── json.js │ └── Arrow-function.js ├── notes-data.json ├── package.json ├── notes.js ├── app.js └── package-lock.json ├── FS-2 ├── .gitignore ├── greetings.txt ├── notes.js ├── package.json ├── package-lock.json └── app.js ├── User input ├── .gitignore ├── package-lock.json └── app.js ├── node-chat-app ├── .gitignore ├── public │ ├── index.html │ └── js │ │ └── chat.js ├── package.json └── server │ └── server.js ├── node-todo-api ├── .gitignore ├── server │ ├── db │ │ └── mongoose.js │ ├── config │ │ ├── config.json │ │ └── config.js │ ├── middleware │ │ └── authenticate.js │ ├── models │ │ ├── todo.js │ │ └── user.js │ ├── tests │ │ ├── seed │ │ │ └── seed.js │ │ └── server.test.js │ └── server.js ├── playground │ ├── mongoose-remove.js │ ├── mongodb-update.js │ ├── mongodb-find.js │ ├── mongoose-queries.js │ ├── mongodb-connect.js │ ├── mongodb-delete.js │ └── hashing.js └── package.json ├── push notification ├── .gitignore ├── jsoncontent.json ├── package.json ├── books-api.js ├── push_notification.js └── package-lock.json ├── .gitignore ├── aynsc-await-node ├── .gitignore ├── package.json ├── currency-convert.js ├── package-lock.json └── app-promises.js ├── hostel Management ├── .gitignore ├── views │ ├── .gitignore │ ├── login.hbs │ └── dashboard.hbs ├── package.json ├── public │ └── html.html ├── server.js └── server.log ├── weather ├── .gitignore ├── n-4-10-weather │ ├── playground │ │ ├── async-basics.js │ │ └── callbacks.js │ ├── package.json │ ├── geocode │ │ └── geocode.js │ └── app.js └── package-lock.json ├── node-web-server ├── .gitignore ├── views │ ├── partials │ │ ├── footer.hbs │ │ └── header.hbs │ ├── about.hbs │ ├── maintenance.hbs │ ├── home.hbs │ └── projects.hbs ├── package.json ├── public │ └── help.html └── server.js ├── .gitattributes ├── node-tests ├── spies │ ├── db.js │ ├── app.js │ └── app.test.js ├── package.json ├── server │ ├── server.js │ └── server.test.js └── utils │ ├── utils.js │ └── utils.test.js ├── 3rd-party-modules ├── .DS_Store ├── greetings.txt ├── notes.js ├── package.json └── app.js ├── Eventemitter ├── app.js └── Logger.js ├── Weather-app ├── playground │ ├── callbacks.js │ ├── async-basics.js │ ├── promise-2.js │ └── promise.js ├── package.json ├── weather │ └── weather.js ├── app.js ├── geocode │ └── geocode.js ├── request download.txt └── app-promise.js ├── PArt-1 ├── Helloworld.js ├── logger.js └── app.js ├── HTTP SERVER └── app.js ├── README.md ├── Unicorn.code-workspace ├── text to read.txt ├── LICENSE ├── Nodeman └── nodeman.txt ├── uploading app to heroku.txt ├── after login check for keys and deploy git app to heriku.txt └── GitBASH Text when run first time .txt /FS/app.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /yargs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /FS-2/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /User input/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /node-chat-app/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /node-todo-api/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /push notification/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /yargs/playground/notes.json: -------------------------------------------------------------------------------- 1 | [object Object] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | keys.txt 3 | *.mp4 -------------------------------------------------------------------------------- /FS-2/greetings.txt: -------------------------------------------------------------------------------- 1 | hello lenovo ! You are 21 -------------------------------------------------------------------------------- /aynsc-await-node/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | node_modules -------------------------------------------------------------------------------- /hostel Management/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | keys.txt -------------------------------------------------------------------------------- /weather/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | keys.txt 3 | *.mp4 -------------------------------------------------------------------------------- /hostel Management/views/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | keys.txt 3 | css 4 | lib -------------------------------------------------------------------------------- /node-web-server/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | server.log 3 | package-lock.json -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /node-tests/spies/db.js: -------------------------------------------------------------------------------- 1 | module.exports.saveUser =(user)=>{ 2 | console.log('saving the user',user); 3 | 4 | }; -------------------------------------------------------------------------------- /yargs/notes-data.json: -------------------------------------------------------------------------------- 1 | [{"title":"se","body":"saome text"},{"title":"secret3","body":"saome text"},{"title":"list","body":"body"}] -------------------------------------------------------------------------------- /3rd-party-modules/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Complete-nodeJS-developer-course/master/3rd-party-modules/.DS_Store -------------------------------------------------------------------------------- /node-web-server/views/partials/footer.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /3rd-party-modules/greetings.txt: -------------------------------------------------------------------------------- 1 | Hello world!Hello world!Hello Andrew!Hello Andrew! 2 | Hello Andrew!Hello Andrew!Hello Andrew!Hello Andrew! You are 25. -------------------------------------------------------------------------------- /push notification/jsoncontent.json: -------------------------------------------------------------------------------- 1 | { 2 | "username":"xyz", 3 | "password":"xyz@123", 4 | "email":"xyz@xyz.com", 5 | "uid": 1100 6 | } -------------------------------------------------------------------------------- /yargs/playground/debugging.js: -------------------------------------------------------------------------------- 1 | var person ={ 2 | 3 | name :'Ashlesh' 4 | 5 | }; 6 | 7 | person.age =25; 8 | 9 | 10 | debugger; 11 | person.name ='mike'; 12 | 13 | console.log(person); 14 | -------------------------------------------------------------------------------- /node-todo-api/server/db/mongoose.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | 3 | mongoose.Promise = global.Promise; 4 | mongoose.connect(process.env.MONGODB_URI); 5 | 6 | module.exports = {mongoose}; 7 | 8 | -------------------------------------------------------------------------------- /3rd-party-modules/notes.js: -------------------------------------------------------------------------------- 1 | console.log('Starting notes.js'); 2 | 3 | module.exports.addNote = () => { 4 | console.log('addNote'); 5 | return 'New note'; 6 | }; 7 | 8 | module.exports.add = (a, b) => { 9 | return a + b; 10 | }; 11 | -------------------------------------------------------------------------------- /node-web-server/views/partials/header.hbs: -------------------------------------------------------------------------------- 1 |
2 | 3 |

{{pageTitle}}

4 |

home

5 |

About

6 |

Projects

7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /weather/n-4-10-weather/playground/async-basics.js: -------------------------------------------------------------------------------- 1 | console.log('Starting app'); 2 | 3 | setTimeout(() => { 4 | console.log('Inside of callback'); 5 | }, 2000); 6 | 7 | setTimeout(() => { 8 | console.log('Second setTimeout'); 9 | }, 0); 10 | 11 | console.log('Finishing up'); 12 | -------------------------------------------------------------------------------- /FS-2/notes.js: -------------------------------------------------------------------------------- 1 | console.log('Starting notes.js....'); 2 | 3 | //console.log(module); 4 | 5 | //module.exports.age=21; 6 | module.exports.addNote =()=>{ 7 | console.log('AddNote'); 8 | return 'New Note'; 9 | 10 | }; 11 | 12 | module.exports.add = (a,b) =>{ 13 | return a+b; 14 | }; -------------------------------------------------------------------------------- /weather/n-4-10-weather/playground/callbacks.js: -------------------------------------------------------------------------------- 1 | var getUser = (id, callback) => { 2 | var user = { 3 | id: id, 4 | name: 'Vikram' 5 | }; 6 | 7 | setTimeout(() => { 8 | callback(user); 9 | }, 3000); 10 | }; 11 | 12 | getUser(31, (userObject) => { 13 | console.log(userObject); 14 | }); 15 | -------------------------------------------------------------------------------- /Eventemitter/app.js: -------------------------------------------------------------------------------- 1 | const EventEmitter = require('events'); 2 | 3 | 4 | // registt alistener 5 | 6 | 7 | const Logger = require('./logger'); 8 | const logger= new Logger(); 9 | 10 | logger.on('messageLogged',(arg)=> { 11 | console.log('Lsitener called',arg); 12 | }); 13 | 14 | logger.log('message'); 15 | -------------------------------------------------------------------------------- /Weather-app/playground/callbacks.js: -------------------------------------------------------------------------------- 1 | var getUser =(id,callback) => 2 | { 3 | var user ={ 4 | id : id, 5 | name :'Ashleshk' 6 | }; 7 | setTimeout(() =>{callback(user)},3000); 8 | }; 9 | 10 | getUser(31,(userObject)=> 11 | { 12 | console.log(userObject); 13 | 14 | }); 15 | 16 | -------------------------------------------------------------------------------- /PArt-1/Helloworld.js: -------------------------------------------------------------------------------- 1 | function sayHello(name) 2 | { 3 | console.log('hello '+ name); ///this is global OBject 4 | 5 | //fucntion stadard js 6 | setTimeout(); 7 | clearTimeout(); 8 | setInterval() 9 | } 10 | 11 | sayHello('Ashlesh'); 12 | 13 | 14 | // we donot have console(window) 15 | //since node arenot dcoucnment 16 | -------------------------------------------------------------------------------- /Eventemitter/Logger.js: -------------------------------------------------------------------------------- 1 | 2 | const EventEmitter = require('events'); 3 | 4 | 5 | var url ='http://gsgss.asdv'; 6 | 7 | class Logger extends EventEmitter{ 8 | log(message) 9 | { 10 | console.log(message); 11 | 12 | this.emit('messageLogged',{id:1,url:'http://'}); 13 | } 14 | } 15 | 16 | module.exports = Logger; 17 | -------------------------------------------------------------------------------- /FS-2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fs-2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "ashlesh khajbage", 10 | "license": "ISC", 11 | "dependencies": { 12 | "lodash": "^4.17.11" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /node-tests/spies/app.js: -------------------------------------------------------------------------------- 1 | var db =require('./db.js'); 2 | 3 | // 4 | //spies to know whether the function inside function is assesd 5 | 6 | module.exports.handleSignup =(email,password)=>{ 7 | //chech if email already exist 8 | db.saveUser({email,password}); 9 | //save the user to database 10 | //send welcome email' 11 | 12 | }; -------------------------------------------------------------------------------- /3rd-party-modules/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notes-node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Andrew Mead", 10 | "license": "ISC", 11 | "dependencies": { 12 | "lodash": "^4.13.1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aynsc-await-node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aynsc-await-node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app-promises.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^0.18.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /push notification/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "push-notification", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "books-api.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "request": "^2.88.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /node-todo-api/server/config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": { 3 | "PORT": 3000, 4 | "MONGODB_URI": "mongodb://localhost:27017/TodoAppTest", 5 | "JWT_SECRET": "poijasdf98435jpgfdpoij3" 6 | }, 7 | "development": { 8 | "PORT": 3000, 9 | "MONGODB_URI": "mongodb://localhost:27017/TodoApp", 10 | "JWT_SECRET": "pojiaj234oi234oij234oij4" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /weather/n-4-10-weather/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weather-app", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "request": "^2.73.0", 13 | "yargs": "^4.8.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /User input/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "lodash": { 6 | "version": "4.17.11", 7 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 8 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /yargs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notes-node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Andrew Mead", 10 | "license": "ISC", 11 | "dependencies": { 12 | "loadash": "^1.0.0", 13 | "lodash": "^4.17.11", 14 | "yargs": "^12.0.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /HTTP SERVER/app.js: -------------------------------------------------------------------------------- 1 | const http = require('http'); 2 | const server = http.createServer((req,res)=>{ 3 | if(req.url === '/') 4 | { 5 | res.write('hello world'); 6 | res.end(); 7 | } 8 | if(res.url ==='/api/courses'){ 9 | res.write(JSON.stringify([1,2,3])); 10 | res.end(); 11 | } 12 | }); 13 | 14 | 15 | server.listen(3000); 16 | console.log('Listenning on Port 3000 ......'); 17 | -------------------------------------------------------------------------------- /node-web-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.16.3", 14 | "hbs": "^4.0.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /hostel Management/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hostel-management", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.16.3", 14 | "hbs": "^4.0.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /FS-2/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fs-2", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "lodash": { 8 | "version": "4.17.11", 9 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 10 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Complete-nodeJS-developer-course 2 | Complete NodeJS Developer course on Udemy 3 | 4 | ## Projects 5 | - Hello-World 6 | - User Input 7 | - Push Notification 8 | - Yargs 9 | - 3rd Party Modules 10 | - Event Emitter 11 | - Nodeman 12 | - Node-TODO-api 13 | - Node-Web-Server 14 | - Node-Chat_App 15 | - Node Test 16 | - Async Await Node 17 | - File System 18 | - HTTP Server 19 | - Hostel Management 20 | - Weather App 21 | 22 | -------------------------------------------------------------------------------- /Weather-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weather-app", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "author": "Ashlesh", 9 | "license": "ISC", 10 | "dependencies": { 11 | "axios": "^0.18.0", 12 | "got": "^9.2.2", 13 | "lodash": "^4.17.11", 14 | "request": "^2.88.0", 15 | "yargs": "^12.0.2" 16 | }, 17 | "devDependencies": {}, 18 | "description": "" 19 | } 20 | -------------------------------------------------------------------------------- /hostel Management/public/html.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Help 7 | 8 | 9 | 10 | 11 | 12 |

Help Page

13 |

some text here

14 | 15 | -------------------------------------------------------------------------------- /node-todo-api/server/middleware/authenticate.js: -------------------------------------------------------------------------------- 1 | var {User} = require('./../models/user'); 2 | 3 | var authenticate = (req, res, next) => { 4 | var token = req.header('x-auth'); 5 | 6 | User.findByToken(token).then((user) => { 7 | if (!user) { 8 | return Promise.reject(); 9 | } 10 | 11 | req.user = user; 12 | req.token = token; 13 | next(); 14 | }).catch((e) => { 15 | res.status(401).send(); 16 | }); 17 | }; 18 | 19 | module.exports = {authenticate}; 20 | -------------------------------------------------------------------------------- /node-web-server/public/help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Help 7 | 8 | 9 | 10 | 11 | 12 |

Help Page

13 |

some text here

14 | 15 | -------------------------------------------------------------------------------- /node-tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tests", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "mocha **/*.test.js", 8 | "test-watch": "nodemon --exec \"npm test\"" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "expect": "^1.20.2", 14 | "mocha": "^5.2.0", 15 | "rewire": "^2.5.2", 16 | "supertest": "^3.3.0" 17 | }, 18 | "dependencies": { 19 | "express": "^4.14.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /node-todo-api/server/models/todo.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | 3 | var Todo = mongoose.model('Todo', { 4 | text: { 5 | type: String, 6 | required: true, 7 | minlength: 1, 8 | trim: true 9 | }, 10 | completed: { 11 | type: Boolean, 12 | default: false 13 | }, 14 | completedAt: { 15 | type: Number, 16 | default: null 17 | }, 18 | _creator: { 19 | type: mongoose.Schema.Types.ObjectId, 20 | required: true 21 | } 22 | }); 23 | 24 | module.exports = {Todo}; 25 | -------------------------------------------------------------------------------- /node-web-server/views/about.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{pageTitle}} 7 | 8 | 9 | 10 | 11 | 12 | {{> header}} 13 |

some text here

14 | 15 | {{> footer}} 16 | 17 | -------------------------------------------------------------------------------- /node-web-server/views/maintenance.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Some website 7 | 8 | 9 | 10 | 11 | 12 |

We'll be right back

13 |

this site currenlty being updated

14 | 15 | -------------------------------------------------------------------------------- /node-web-server/views/home.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{pageTitle}} 7 | 8 | 9 | 10 | 11 | 12 | {{> header}} 13 |

{{screamIt welcomeMessage}}

14 | 15 | {{> footer}} 16 | 17 | -------------------------------------------------------------------------------- /node-web-server/views/projects.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{pageTitle}} 7 | 8 | 9 | 10 | 11 | 12 | {{> header}} 13 |

Project page text would go here

14 | 15 | {{> footer}} 16 | 17 | -------------------------------------------------------------------------------- /3rd-party-modules/app.js: -------------------------------------------------------------------------------- 1 | console.log('Starting app.js'); 2 | 3 | const fs = require('fs'); 4 | const os = require('os'); 5 | const _ = require('lodash'); 6 | const notes = require('./notes.js'); 7 | 8 | // console.log(_.isString(true)); 9 | // console.log(_.isString('Andrew')); 10 | var filteredArray = _.uniq(['Andrew', 1, 'Andrew', 1, 2, 3, 4]); 11 | console.log(filteredArray); 12 | 13 | // console.log('Result:', notes.add(9, -2)); 14 | 15 | // var user = os.userInfo(); 16 | // 17 | // fs.appendFile('greetings.txt', `Hello ${user.username}! You are ${notes.age}.`); 18 | -------------------------------------------------------------------------------- /PArt-1/logger.js: -------------------------------------------------------------------------------- 1 | // THIS IS specific to this module and no need to sdhare to other 2 | //hence private .. ..... .also no need to export 3 | var url= 'http://mylogger.io/log'; 4 | console.log(__filename); 5 | console.log(__dirname); 6 | function log(message) 7 | { 8 | 9 | //send the http request 10 | console.log(message); 11 | } 12 | 13 | // to access this modules method to main 14 | module.exports.log=log; 15 | 16 | //to accss the variables 17 | //module.exports.endpoint =url; 18 | 19 | 20 | //sending jus the single modules 21 | /* 22 | * module.exports = log; 23 | */ 24 | -------------------------------------------------------------------------------- /node-chat-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Join | ChatApp 7 | 8 | 9 | 10 | 11 |

welcome to the chat app

12 | 13 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /node-tests/server/server.js: -------------------------------------------------------------------------------- 1 | const express =require('express'); 2 | 3 | var app = express(); 4 | 5 | 6 | app.get('/',(req,res )=>{ 7 | res.status(404).send({ 8 | error:'page not found.', 9 | name:'Todo App v1.0' 10 | }); 11 | }); 12 | 13 | 14 | app.get('/users',(rew,res)=>{ 15 | res.send([{ 16 | name:'mike', 17 | age:21 18 | },{ 19 | name:'Ashlesh', 20 | age:21 21 | },{ 22 | name:'Apoorva', 23 | age:18 24 | }]); 25 | }); 26 | 27 | app.listen(3000); 28 | module.exports.app =app; -------------------------------------------------------------------------------- /node-chat-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chat-app", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node server/server.js", 8 | "test": "mocha server/**/*.test.js", 9 | "test-watch": "nodemon --exec 'npm test'" 10 | }, 11 | "engines": { 12 | "node": "6.2.2" 13 | }, 14 | "author": "", 15 | "license": "ISC", 16 | "dependencies": { 17 | "express": "^4.16.4", 18 | "socket.io": "^1.4.8" 19 | }, 20 | "devDependencies": { 21 | "expect": "^23.6.0", 22 | "mocha": "^5.2.0", 23 | "nodemon": "^1.18.6" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /node-todo-api/playground/mongoose-remove.js: -------------------------------------------------------------------------------- 1 | const {ObjectID} = require('mongodb'); 2 | 3 | const {mongoose} = require('./../server/db/mongoose'); 4 | const {Todo} = require('./../server/models/todo'); 5 | const {User} = require('./../server/models/user'); 6 | 7 | // Todo.remove({}).then((result) => { 8 | // console.log(result); 9 | // }); 10 | 11 | // Todo.findOneAndRemove 12 | // Todo.findByIdAndRemove 13 | 14 | // Todo.findOneAndRemove({_id: '57c4610dbb35fcbf6fda1154'}).then((todo) => { 15 | // 16 | // }); 17 | 18 | Todo.findByIdAndRemove('57c4610dbb35fcbf6fda1154').then((todo) => { 19 | console.log(todo); 20 | }); 21 | -------------------------------------------------------------------------------- /node-todo-api/server/config/config.js: -------------------------------------------------------------------------------- 1 | var env = process.env.NODE_ENV || 'development'; 2 | 3 | if (env === 'development' || env === 'test') { 4 | var config = require('./config.json'); 5 | var envConfig = config[env]; 6 | 7 | Object.keys(envConfig).forEach((key) => { 8 | process.env[key] = envConfig[key]; 9 | }); 10 | } 11 | 12 | // if (env === 'development') { 13 | // process.env.PORT = 3000; 14 | // process.env.MONGODB_URI = 'mongodb://localhost:27017/TodoApp'; 15 | // } else if (env === 'test') { 16 | // process.env.PORT = 3000; 17 | // process.env.MONGODB_URI = 'mongodb://localhost:27017/TodoAppTest'; 18 | // } 19 | -------------------------------------------------------------------------------- /Unicorn.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "HTTP SERVER" 5 | }, 6 | { 7 | "path": "FS-2" 8 | }, 9 | { 10 | "path": "Eventemitter" 11 | }, 12 | { 13 | "path": "FS" 14 | }, 15 | { 16 | "path": "PArt-1" 17 | }, 18 | { 19 | "path": "Nodeman" 20 | }, 21 | { 22 | "path": "User input" 23 | }, 24 | { 25 | "path": "yargs" 26 | }, 27 | { 28 | "path": "Weather-app" 29 | }, 30 | { 31 | "path": "node-web-server" 32 | }, 33 | { 34 | "path": "hostel Management" 35 | }, 36 | { 37 | "path": "node-tests" 38 | } 39 | ], 40 | "settings": { 41 | "git.ignoreLimitWarning": true 42 | } 43 | } -------------------------------------------------------------------------------- /FS-2/app.js: -------------------------------------------------------------------------------- 1 | console.log('staring app...'); 2 | 3 | const fs= require('fs'); 4 | const os = require('os'); 5 | const _ = require('lodash'); 6 | 7 | const notes = require('./notes.js'); 8 | 9 | var user =os.userInfo(); 10 | 11 | var result = notes.addNote(); 12 | console.log(result); 13 | console.log("Result :", notes.add(3,6.5)); 14 | console.log(_.isString(true)); 15 | console.log(_.isString('ashles4')); 16 | 17 | 18 | //console.log(user); 19 | 20 | // fs.appendFile('greetings.txt','hello '+user.username +' '+`! You are ${notes.age}`,function (err) 21 | // { 22 | // if(err){ 23 | // console.log('Unable to write to file'); 24 | // } 25 | 26 | // }); 27 | -------------------------------------------------------------------------------- /node-tests/utils/utils.js: -------------------------------------------------------------------------------- 1 | module.exports.add= (a,b)=> a+b; 2 | 3 | module.exports.asyncAdd =(a,b,callback)=>{ 4 | setTimeout(() => { 5 | callback(a+b); 6 | }, 1000);//loca assumes if your test longer than 2 sec as failure 7 | }; 8 | module.exports.square =(x)=>x*x; 9 | 10 | //async squre methid 11 | module.exports.asyncsquare=(a, callback)=>{ 12 | setTimeout(() => { 13 | callback(a*a); 14 | }, 1000);//loca assumes if your test longer than 2 sec as failure 15 | }; 16 | 17 | module.exports.setname =(user, fullname)=>{ 18 | var names =fullname.split(' '); 19 | user.firstname = names[0]; 20 | user.Lastname = names[1]; 21 | return user; 22 | } -------------------------------------------------------------------------------- /Weather-app/playground/async-basics.js: -------------------------------------------------------------------------------- 1 | console.log('Staring app'); 2 | 3 | 4 | 5 | //this only register the callback function and ask node to move forward till the timeout 6 | 7 | setTimeout(() => { 8 | console.log('inside of callback'); 9 | 10 | }, 2000); 11 | 12 | 13 | // Staring app 14 | // finishing app 15 | // inside of callback 16 | // PS I:\PROGRAM\Node.js\weather-app> 17 | 18 | //this is with zero timout still it 19 | setTimeout(() => { 20 | console.log('new settimeout'); 21 | 22 | },0); 23 | 24 | console.log('finishing app'); 25 | 26 | // Staring app 27 | // finishing app 28 | // new settimeout 29 | // inside of callback 30 | // PS I:\PROGRAM\Node.js\weather-app> -------------------------------------------------------------------------------- /push notification/books-api.js: -------------------------------------------------------------------------------- 1 | // var fs = require("fs"); 2 | // console.log("\n *STARTING* \n"); 3 | // // Get content from file 4 | // var contents = fs.readFileSync("jsoncontent.json"); 5 | // // Define to JSON type 6 | // var jsonContent = JSON.parse(contents); 7 | // // Get Value from JSON 8 | // console.log("User Name:", jsonContent.username); 9 | // console.log("Email:", jsonContent.email); 10 | // console.log("Password:", jsonContent.password); 11 | // console.log("\n *EXIT* \n");y 12 | const request = require('request'); 13 | 14 | request({ 15 | url:'https://www.googleapis.com/books/v1/volumes?q=isbn:1449344682', 16 | json:true 17 | },(error,response,body)=>{ 18 | console.log(body); 19 | 20 | } 21 | ); -------------------------------------------------------------------------------- /node-chat-app/server/server.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const http = require('http'); 3 | const express = require('express'); 4 | const socketIO = require('socket.io'); 5 | 6 | 7 | 8 | const publicPath = path.join(__dirname, '../public'); 9 | const port = process.env.PORT || 3000; 10 | var app = express(); 11 | var server = http.createServer(app); 12 | var io = socketIO(server); 13 | 14 | app.use(express.static(publicPath)); 15 | 16 | 17 | io.on('connection', (socket) => { 18 | console.log('New user connected'); 19 | 20 | socket.on('disconnect',()=>{ 21 | console.log('user was disconnected'); 22 | 23 | }); 24 | }); 25 | 26 | 27 | 28 | server.listen(port, () => { 29 | console.log(`Server is up on ${port}`); 30 | }); 31 | -------------------------------------------------------------------------------- /yargs/playground/json.js: -------------------------------------------------------------------------------- 1 | // var obj ={ 2 | // name : 'Ashlesh' 3 | // }; 4 | 5 | // var stringobj =JSON.stringify(obj); 6 | // console.log(typeof stringobj); 7 | // console.log(stringobj); 8 | 9 | // var personString ='{"name": "AShleshk","age":"21"}'; 10 | // var person = JSON.parse(personString); 11 | // console.log(typeof person); 12 | // console.log(person ); 13 | 14 | const fs = require('fs'); 15 | var originalNote ={ 16 | title:'Some title',body:'some body' 17 | }; 18 | var originalNotString = JSON.stringify(originalNote); 19 | fs.writeFileSync('notes.json',originalNotString); 20 | 21 | var noteString=fs.readFileSync('notes.json'); 22 | 23 | //note 24 | var note=JSON.parse(); 25 | console.log(typeof note); 26 | console.log(note.title); 27 | 28 | 29 | -------------------------------------------------------------------------------- /push notification/push_notification.js: -------------------------------------------------------------------------------- 1 | import {Permissions,Notifications} from 'expo'; 2 | import {AsyncStorage} from 'react-native'; 3 | import axios from 'axios'; 4 | 5 | const PUSH_ENDPOINT='---url---'; 6 | 7 | export default aysnc (() => { 8 | let previousToken = await AsyncStorage.getItem('pushToken'); 9 | 10 | if(previousToken) 11 | { 12 | return; 13 | }else { 14 | let {status} = await Permissions.askAsync(Permissions.REMOTE_NOTIFICATIONS); 15 | 16 | if(status !=='granted'){ 17 | return; 18 | } 19 | 20 | let token =await Notifications.getExponentPushTokenAsync(); 21 | 22 | await axios.post(PUSH_ENDPOINT,{token:{token}}); 23 | AsyncStorage.setItem('pushtoken',token); 24 | } 25 | }); -------------------------------------------------------------------------------- /User input/app.js: -------------------------------------------------------------------------------- 1 | console.log('staring app...'); 2 | 3 | const fs= require('fs'); 4 | 5 | const _ = require('lodash'); 6 | 7 | // this agrv is argument vector , all command line argument are passed in 8 | //console.log(process.argv); 9 | 10 | var command = process.argv[2]; 11 | console.log("Cammand : " , command); 12 | 13 | 14 | if(command === 'add') 15 | { 16 | console.log('Adding New Items'); 17 | 18 | } 19 | else if(command ==='list') 20 | { 21 | console.log('Listing All Notes'); 22 | 23 | } 24 | else if(command ==='read') 25 | { 26 | console.log('reading All Notes'); 27 | 28 | } 29 | else if(command ==='remove') 30 | { 31 | console.log('remove All Notes'); 32 | 33 | } 34 | else 35 | console.log('Cammnad Not recogniseda'); 36 | -------------------------------------------------------------------------------- /yargs/playground/Arrow-function.js: -------------------------------------------------------------------------------- 1 | var square = (x) => x * x ; 2 | 3 | console.log(square(4)); 4 | 5 | var user = 6 | { 7 | 8 | name : 'ashlesh', 9 | sayhi : () => { 10 | console.log(arguments); 11 | console.log(` hi . i'm ${this.name}`); 12 | //hi . i'm undefined 13 | /* 14 | becoz her the arrow function does not bind this\argv keyword to object 15 | this here search for parent ... here it does not exist 16 | 17 | ... hence this goes for the gloabal object 18 | */ 19 | 20 | }, 21 | 22 | //resolving issue 23 | sayhiAlt () { 24 | console.log(arguments); 25 | console.log(` hi . i'm ${this.name}`); 26 | 27 | } 28 | }; 29 | user.sayhi(1,2,3); 30 | user.sayhiAlt(1,2,3); 31 | 32 | -------------------------------------------------------------------------------- /text to read.txt: -------------------------------------------------------------------------------- 1 | 2 | I:\PROGRAM\Node.js>node app.js 3 | { log: [Function: log] } 4 | 5 | I:\PROGRAM\Node.js>node app.js 6 | { log: [Function: log] } 7 | messgae 8 | 9 | I:\PROGRAM\Node.js>node app.js 10 | I:\PROGRAM\Node.js\logger.js 11 | I:\PROGRAM\Node.js 12 | { log: [Function: log] } 13 | messgae 14 | 15 | I:\PROGRAM\Node.js>node app.js 16 | I:\PROGRAM\Node.js\logger.js 17 | I:\PROGRAM\Node.js 18 | { log: [Function: log] } 19 | messgae 20 | { root: 'I:\\', 21 | dir: 'I:\\PROGRAM\\Node.js', 22 | base: 'app.js', 23 | ext: '.js', 24 | name: 'app' } 25 | 26 | I:\PROGRAM\Node.js>node app.js 27 | I:\PROGRAM\Node.js\logger.js 28 | I:\PROGRAM\Node.js 29 | { log: [Function: log] } 30 | messgae 31 | { root: 'I:\\', 32 | dir: 'I:\\PROGRAM\\Node.js', 33 | base: 'app.js', 34 | ext: '.js', 35 | name: 'app' } 36 | 8441929728 37 | 2923745280 38 | -------------------------------------------------------------------------------- /weather/n-4-10-weather/geocode/geocode.js: -------------------------------------------------------------------------------- 1 | const request = require('request'); 2 | 3 | var geocodeAddress = (address, callback) => { 4 | var encodedAddress = encodeURIComponent(address); 5 | 6 | request({ 7 | url: `https://maps.googleapis.com/maps/api/geocode/json?address=${encodedAddress}`, 8 | json: true 9 | }, (error, response, body) => { 10 | if (error) { 11 | callback('Unable to connect to Google servers.'); 12 | } else if (body.status === 'ZERO_RESULTS') { 13 | callback('Unable to find that address.'); 14 | } else if (body.status === 'OK') { 15 | callback(undefined, { 16 | address: body.results[0].formatted_address, 17 | latitude: body.results[0].geometry.location.lat, 18 | longitude: body.results[0].geometry.location.lng 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports.geocodeAddress = geocodeAddress; 25 | -------------------------------------------------------------------------------- /Weather-app/weather/weather.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | const request = require('request'); 4 | var getWeather = (lat,lng,callback) =>{ 5 | request({ 6 | url:`https://api.forecast.io/forecast/c9ea14a026c159bb5ecb6848b0ea492f/${lat},${lng}`, 7 | json: true 8 | }, (error, response, body) => { 9 | if (error) { 10 | callback('Unable to connect to Forecast.io server.'); 11 | } else if (response.statusCode === 400) { 12 | callback('Unable to fetch weather.'); 13 | } else if (response.statusCode === 200) { 14 | callback(undefined,{ 15 | temperature :body.currently.temperature, 16 | apparentTemperature:body.currently.apparentTemperature, 17 | humidity : body.currently.humidity, 18 | precipProbability: body.currently.precipProbability 19 | }); 20 | 21 | } 22 | }); 23 | 24 | 25 | }; 26 | 27 | module.exports.getWeather = getWeather; -------------------------------------------------------------------------------- /node-todo-api/playground/mongodb-update.js: -------------------------------------------------------------------------------- 1 | // const MongoClient = require('mongodb').MongoClient; 2 | const {MongoClient, ObjectID} = require('mongodb'); 3 | 4 | MongoClient.connect('mongodb://localhost:27017/TodoApp', (err, db) => { 5 | if (err) { 6 | return console.log('Unable to connect to MongoDB server'); 7 | } 8 | console.log('Connected to MongoDB server'); 9 | 10 | // db.collection('Todos').findOneAndUpdate({ 11 | // _id: new ObjectID('57bc4b15b3b6a3801d8c47a2') 12 | // }, { 13 | // $set: { 14 | // completed: true 15 | // } 16 | // }, { 17 | // returnOriginal: false 18 | // }).then((result) => { 19 | // console.log(result); 20 | // }); 21 | 22 | db.collection('Users').findOneAndUpdate({ 23 | _id: new ObjectID('57abbcf4fd13a094e481cf2c') 24 | }, { 25 | $set: { 26 | name: 'Andrew' 27 | }, 28 | $inc: { 29 | age: 1 30 | } 31 | }, { 32 | returnOriginal: false 33 | }).then((result) => { 34 | console.log(result); 35 | }); 36 | 37 | // db.close(); 38 | }); 39 | -------------------------------------------------------------------------------- /node-todo-api/playground/mongodb-find.js: -------------------------------------------------------------------------------- 1 | // const MongoClient = require('mongodb').MongoClient; 2 | const {MongoClient, ObjectID} = require('mongodb'); 3 | 4 | MongoClient.connect('mongodb://localhost:27017/TodoApp', (err, db) => { 5 | if (err) { 6 | return console.log('Unable to connect to MongoDB server'); 7 | } 8 | console.log('Connected to MongoDB server'); 9 | 10 | // db.collection('Todos').find({ 11 | // _id: new ObjectID('57bb36afb3b6a3801d8c479d') 12 | // }).toArray().then((docs) => { 13 | // console.log('Todos'); 14 | // console.log(JSON.stringify(docs, undefined, 2)); 15 | // }, (err) => { 16 | // console.log('Unable to fetch todos', err); 17 | // }); 18 | 19 | // db.collection('Todos').find().count().then((count) => { 20 | // console.log(`Todos count: ${count}`); 21 | // }, (err) => { 22 | // console.log('Unable to fetch todos', err); 23 | // }); 24 | 25 | db.collection('Users').find({name: 'Andrew'}).toArray().then((docs) => { 26 | console.log(JSON.stringify(docs, undefined, 2)); 27 | }); 28 | 29 | // db.close(); 30 | }); 31 | -------------------------------------------------------------------------------- /node-todo-api/playground/mongoose-queries.js: -------------------------------------------------------------------------------- 1 | const {ObjectID} = require('mongodb'); 2 | 3 | const {mongoose} = require('./../server/db/mongoose'); 4 | const {Todo} = require('./../server/models/todo'); 5 | const {User} = require('./../server/models/user'); 6 | 7 | // var id = '57bf38394b39c93d2a557e9811'; 8 | // 9 | // if (!ObjectID.isValid(id)) { 10 | // console.log('ID not valid'); 11 | // } 12 | 13 | // Todo.find({ 14 | // _id: id 15 | // }).then((todos) => { 16 | // console.log('Todos', todos); 17 | // }); 18 | // 19 | // Todo.findOne({ 20 | // _id: id 21 | // }).then((todo) => { 22 | // console.log('Todo', todo); 23 | // }); 24 | 25 | // Todo.findById(id).then((todo) => { 26 | // if (!todo) { 27 | // return console.log('Id not found'); 28 | // } 29 | // console.log('Todo By Id', todo); 30 | // }).catch((e) => console.log(e)); 31 | 32 | User.findById('57bdb0fcdedf88540bfa2d66').then((user) => { 33 | if (!user) { 34 | return console.log('Unable to find user'); 35 | } 36 | 37 | console.log(JSON.stringify(user, undefined, 2)); 38 | }, (e) => { 39 | console.log(e); 40 | }); 41 | -------------------------------------------------------------------------------- /node-todo-api/playground/mongodb-connect.js: -------------------------------------------------------------------------------- 1 | // const MongoClient = require('mongodb').MongoClient; 2 | const {MongoClient, ObjectID} = require('mongodb'); 3 | 4 | MongoClient.connect('mongodb://localhost:27017/TodoApp', (err, db) => { 5 | if (err) { 6 | return console.log('Unable to connect to MongoDB server'); 7 | } 8 | console.log('Connected to MongoDB server'); 9 | 10 | // db.collection('Todos').insertOne({ 11 | // text: 'Something to do', 12 | // completed: false 13 | // }, (err, result) => { 14 | // if (err) { 15 | // return console.log('Unable to insert todo', err); 16 | // } 17 | // 18 | // console.log(JSON.stringify(result.ops, undefined, 2)); 19 | // }); 20 | 21 | // Insert new doc into Users (name, age, location) 22 | // db.collection('Users').insertOne({ 23 | // name: 'Andrew', 24 | // age: 25, 25 | // location: 'Philadelphia' 26 | // }, (err, result) => { 27 | // if (err) { 28 | // return console.log('Unable to insert user', err); 29 | // } 30 | // 31 | // console.log(result.ops[0]._id.getTimestamp()); 32 | // }); 33 | 34 | db.close(); 35 | }); 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ashlesh Khajbage 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node-todo-api/playground/mongodb-delete.js: -------------------------------------------------------------------------------- 1 | // const MongoClient = require('mongodb').MongoClient; 2 | const {MongoClient, ObjectID} = require('mongodb'); 3 | 4 | MongoClient.connect('mongodb://localhost:27017/TodoApp', (err, db) => { 5 | if (err) { 6 | return console.log('Unable to connect to MongoDB server'); 7 | } 8 | console.log('Connected to MongoDB server'); 9 | 10 | // deleteMany 11 | // db.collection('Todos').deleteMany({text: 'Eat lunch'}).then((result) => { 12 | // console.log(result); 13 | // }); 14 | 15 | // deleteOne 16 | // db.collection('Todos').deleteOne({text: 'Eat lunch'}).then((result) => { 17 | // console.log(result); 18 | // }); 19 | 20 | // findOneAndDelete 21 | // db.collection('Todos').findOneAndDelete({completed: false}).then((result) => { 22 | // console.log(result); 23 | // }); 24 | 25 | // db.collection('Users').deleteMany({name: 'Andrew'}); 26 | 27 | db.collection('Users').findOneAndDelete({ 28 | _id: new ObjectID("57ac8d47878a299e5dc21bc8") 29 | }).then((results) => { 30 | console.log(JSON.stringify(results, undefined, 2)); 31 | }); 32 | 33 | // db.close(); 34 | }); 35 | -------------------------------------------------------------------------------- /node-todo-api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todo-api", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "start": "node server/server.js", 7 | "test": "SET \"NODE_ENV=test\" && mocha server/**/*.test.js", 8 | "test-watch": "nodemon --exec 'npm test'" 9 | }, 10 | "engines": { 11 | "node": "6.2.2" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "dependencies": { 16 | "bcryptjs": "^2.3.0", 17 | "body-parser": "^1.15.2", 18 | "crypto-js": "^3.1.6", 19 | "express": "^4.14.0", 20 | "jsonwebtoken": "^7.1.9", 21 | "lodash": "^4.17.11", 22 | "mongodb": "^2.2.5", 23 | "mongoose": "^4.5.9", 24 | "validator": "^5.6.0" 25 | }, 26 | "devDependencies": { 27 | "expect": "^21.1.0", 28 | "mocha": "^3.0.2", 29 | "nodemon": "^1.10.2", 30 | "supertest": "^2.0.0" 31 | }, 32 | "repository": { 33 | "type": "git", 34 | "url": "git+https://github.com/andrewjmead/node-course-2-todo-api.git" 35 | }, 36 | "bugs": { 37 | "url": "https://github.com/andrewjmead/node-course-2-todo-api/issues" 38 | }, 39 | "homepage": "https://github.com/andrewjmead/node-course-2-todo-api#readme", 40 | "description": "" 41 | } 42 | -------------------------------------------------------------------------------- /weather/n-4-10-weather/app.js: -------------------------------------------------------------------------------- 1 | // const yargs = require('yargs'); 2 | // 3 | // const geocode = require('./geocode/geocode'); 4 | // 5 | // const argv = yargs 6 | // .options({ 7 | // a: { 8 | // demand: true, 9 | // alias: 'address', 10 | // describe: 'Address to fetch weather for', 11 | // string: true 12 | // } 13 | // }) 14 | // .help() 15 | // .alias('help', 'h') 16 | // .argv; 17 | // 18 | // geocode.geocodeAddress(argv.address, (errorMessage, results) => { 19 | // if (errorMessage) { 20 | // console.log(errorMessage); 21 | // } else { 22 | // console.log(JSON.stringify(results, undefined, 2)); 23 | // } 24 | // }); 25 | 26 | // 4a04d1c42fd9d32c97a2c291a32d5e2d 27 | 28 | const request = require('request'); 29 | 30 | request({ 31 | url: 'https://api.forecast.io/forecast/4a04d1c42fd9d32c97a2c291a32d5e2d/39.9396284,-75.18663959999999', 32 | json: true 33 | }, (error, response, body) => { 34 | if (error) { 35 | console.log('Unable to connect to Forecast.io server.'); 36 | } else if (response.statusCode === 400) { 37 | console.log('Unable to fetch weather.'); 38 | } else if (response.statusCode === 200) { 39 | console.log(body.currently.temperature); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /node-tests/spies/app.test.js: -------------------------------------------------------------------------------- 1 | const expect = require('expect'); 2 | const rewire = require('rewire'); 3 | 4 | 5 | var app = rewire('./app'); 6 | ///app.__set__ 7 | ///app.__get__ // this method to make simualtion of db object from db.js 8 | // 9 | // //and swap the function with spy 10 | 11 | 12 | describe('App',()=>{ 13 | 14 | var db ={ 15 | saveUser: expect.createSpy() 16 | }; 17 | //replace it 18 | app.__set__('db', db); 19 | 20 | it('should call the spy correctly',()=>{ 21 | //creating a sspy 22 | var spy=expect.createSpy(); //createspy will return a function that will 23 | //swap for real one 24 | 25 | //inject spy in code/function 26 | //spy(); 27 | spy('ashlesh',21); 28 | 29 | //set up series of assert(s) 30 | //expect(spy).toHaveBeenCalled(); 31 | expect(spy).toHaveBeenCalledWith('ashlesh', 21); 32 | 33 | }); 34 | 35 | it('should call saveuser with user object',()=>{ 36 | var email = 'andrew@example.com'; 37 | var password = '123abc'; 38 | 39 | app.handleSignup(email, password); 40 | expect(db.saveUser).toHaveBeenCalledWith({email, password}); 41 | }); 42 | 43 | }); 44 | -------------------------------------------------------------------------------- /node-tests/server/server.test.js: -------------------------------------------------------------------------------- 1 | const request = require('supertest'); 2 | const expect=require('expect'); 3 | 4 | 5 | var app = require('./server').app; 6 | 7 | //servers describe 8 | describe('Server',()=>{ 9 | describe('GET /',()=>{ 10 | it('should return hello world response', (done)=>{ 11 | request(app) 12 | .get('/') 13 | .expect(404) 14 | .expect((res)=>{ 15 | expect(res.body).toInclude({ 16 | error:'page not found.' 17 | }); 18 | }) 19 | .end(done); 20 | }); 21 | 22 | }); 23 | 24 | describe('GET ./Users',()=>{ 25 | 26 | //make a new test 27 | //assert 200 28 | //assert that you exist in array 29 | 30 | it('should return my usrr object',(done)=>{ 31 | request(app) 32 | .get('/users') 33 | .expect(200) 34 | .expect((res)=>{ 35 | expect(res.body).toInclude({ 36 | name:'Ashlesh', 37 | age:21 38 | }); 39 | }) 40 | .end(done); 41 | }); 42 | 43 | }); 44 | }); 45 | 46 | 47 | -------------------------------------------------------------------------------- /aynsc-await-node/currency-convert.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | 3 | const getExchangeRate = async (from, to) => { 4 | try { 5 | const response = await axios.get('http://data.fixer.io/api/latest?access_key=28fb091f0ecba07964b7843abea0f119'); 6 | const euro = 1 / response.data.rates[from]; 7 | const rate = euro * response.data.rates[to]; 8 | 9 | if (isNaN(rate)) { 10 | throw new Error(); 11 | } 12 | 13 | return rate; 14 | } catch (e) { 15 | throw new Error(`Unable to get exchange rate for ${from} and ${to}.`); 16 | } 17 | }; 18 | 19 | const getCountries = async (currencyCode) => { 20 | try { 21 | const response = await axios.get(`https://restcountries.eu/rest/v2/currency/${currencyCode}`); 22 | return response.data.map((country) => country.name); 23 | } catch (e) { 24 | throw new Error(`Unable to get countries that use ${currencyCode}.`) 25 | } 26 | }; 27 | 28 | const convertCurrency = async (from, to, amount) => { 29 | const rate = await getExchangeRate(from, to); 30 | const countries = await getCountries(to); 31 | const convertedAmount = (amount * rate).toFixed(2); 32 | return `${amount} ${from} is worth ${convertedAmount} ${to}. You can spend it in the following countries:\n ${countries.join('\n ')}`; 33 | }; 34 | 35 | convertCurrency('USD', 'CAD', 20).then((message) => { 36 | console.log(message); 37 | }).catch((e) => { 38 | console.log(e.message); 39 | }); 40 | 41 | -------------------------------------------------------------------------------- /node-todo-api/playground/hashing.js: -------------------------------------------------------------------------------- 1 | const {SHA256} = require('crypto-js'); 2 | const jwt = require('jsonwebtoken'); 3 | const bcrypt = require('bcryptjs') 4 | 5 | var password = '123abc!'; 6 | 7 | 8 | bcrypt.genSalt(10, (err, salt) => { 9 | bcrypt.hash(password, salt, (err, hash) => { 10 | console.log(hash); 11 | }); 12 | }); 13 | 14 | var hashedPassword = '$2a$10$OlQA3nfx98M53KZIPgZQZu18FGIgEtP/dVN4JRXC5izvI.veCkKJq'; 15 | 16 | bcrypt.compare(password, hashedPassword, (err, res) => { 17 | console.log(res); 18 | }); 19 | 20 | // var data = { 21 | // id: 10 22 | // }; 23 | 24 | // var token = jwt.sign(data, '123abc'); 25 | // console.log(token); 26 | 27 | // var decoded = jwt.verify(token, '123abc'); 28 | // console.log('decoded', decoded); 29 | 30 | // // var message = 'I am user number 3'; 31 | // // var hash = SHA256(message).toString(); 32 | // // 33 | // // console.log(`Message: ${message}`); 34 | // // console.log(`Hash: ${hash}`); 35 | 36 | // var data = { 37 | // id: 4 38 | // }; 39 | // var token = { 40 | // data, 41 | // hash: SHA256(JSON.stringify(data) + 'somesecret').toString() 42 | // } 43 | 44 | 45 | // token.data.id = 5; 46 | // token.hash = SHA256(JSON.stringify(token.data)).toString(); 47 | 48 | 49 | // var resultHash = SHA256(JSON.stringify(token.data) + 'somesecret').toString(); 50 | // if (resultHash === token.hash) { 51 | // console.log('Data was not changed'); 52 | // } else { 53 | // console.log('Data was changed. Do not trust!'); 54 | // } 55 | -------------------------------------------------------------------------------- /node-todo-api/server/tests/seed/seed.js: -------------------------------------------------------------------------------- 1 | const {ObjectID} = require('mongodb'); 2 | const jwt = require('jsonwebtoken'); 3 | 4 | const {Todo} = require('./../../models/todo'); 5 | const {User} = require('./../../models/user'); 6 | 7 | const userOneId = new ObjectID(); 8 | const userTwoId = new ObjectID(); 9 | const users = [{ 10 | _id: userOneId, 11 | email: 'andrew@example.com', 12 | password: 'userOnePass', 13 | tokens: [{ 14 | access: 'auth', 15 | token: jwt.sign({_id: userOneId, access: 'auth'}, process.env.JWT_SECRET).toString() 16 | }] 17 | }, { 18 | _id: userTwoId, 19 | email: 'jen@example.com', 20 | password: 'userTwoPass', 21 | tokens: [{ 22 | access: 'auth', 23 | token: jwt.sign({_id: userTwoId, access: 'auth'}, process.env.JWT_SECRET).toString() 24 | }] 25 | }]; 26 | 27 | const todos = [{ 28 | _id: new ObjectID(), 29 | text: 'First test todo', 30 | _creator: userOneId 31 | }, { 32 | _id: new ObjectID(), 33 | text: 'Second test todo', 34 | completed: true, 35 | completedAt: 333, 36 | _creator: userTwoId 37 | }]; 38 | 39 | const populateTodos = (done) => { 40 | Todo.remove({}).then(() => { 41 | return Todo.insertMany(todos); 42 | }).then(() => done()); 43 | }; 44 | 45 | const populateUsers = (done) => { 46 | User.remove({}).then(() => { 47 | var userOne = new User(users[0]).save(); 48 | var userTwo = new User(users[1]).save(); 49 | 50 | return Promise.all([userOne, userTwo]) 51 | }).then(() => done()); 52 | }; 53 | 54 | //module.exports = {todos, populateTodos}; 55 | module.exports = {todos, populateTodos, users, populateUsers}; 56 | -------------------------------------------------------------------------------- /aynsc-await-node/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aynsc-await-node", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "axios": { 8 | "version": "0.18.0", 9 | "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", 10 | "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", 11 | "requires": { 12 | "follow-redirects": "^1.3.0", 13 | "is-buffer": "^1.1.5" 14 | } 15 | }, 16 | "debug": { 17 | "version": "3.1.0", 18 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 19 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 20 | "requires": { 21 | "ms": "2.0.0" 22 | } 23 | }, 24 | "follow-redirects": { 25 | "version": "1.5.9", 26 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.9.tgz", 27 | "integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==", 28 | "requires": { 29 | "debug": "=3.1.0" 30 | } 31 | }, 32 | "is-buffer": { 33 | "version": "1.1.6", 34 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", 35 | "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" 36 | }, 37 | "ms": { 38 | "version": "2.0.0", 39 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 40 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Weather-app/app.js: -------------------------------------------------------------------------------- 1 | const yargs = require('yargs'); 2 | 3 | const geocode = require('./geocode/geocode.js'); 4 | const weather = require('./weather/weather.js'); 5 | 6 | const argv = yargs 7 | .options({ 8 | a: { 9 | demand : true, 10 | alias: 'address', 11 | describe: 'Address to fetch weather for', 12 | string: true 13 | } 14 | }) 15 | .help() 16 | .alias('help','h') 17 | .argv; 18 | 19 | geocode.geocodeAddress(argv.address, (errorMessage,results) =>{ 20 | if(errorMessage) 21 | { 22 | console.log(errorMessage); 23 | 24 | }else{ 25 | //before adding getWeather Function .... this was staement to print object 26 | //console.log(JSON.stringify(results,undefined,2)); 27 | 28 | //after the getweather function shifted inside this call 29 | console.log(results.address); 30 | weather.getWeather(results.latitude,results.longitude,(errorMessage,weatherResults)=>{ 31 | if(errorMessage) 32 | { 33 | console.log(errorMessage); 34 | 35 | }else{ 36 | // console.log(JSON.stringify(weatherResults,undefined,2)); 37 | console.log(`its currently ${weatherResults.temperature}. But it feels like ${weatherResults.apparentTemperature}. `); 38 | 39 | } 40 | }); 41 | 42 | 43 | } 44 | }); 45 | 46 | //Dark Sky forecast api key 47 | /* c9ea14a026c159bb5ecb6848b0ea492f */ 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Weather-app/geocode/geocode.js: -------------------------------------------------------------------------------- 1 | const request = require('request'); 2 | 3 | var geocodeAddress = (address,callback ) => { 4 | var encodedAddress = encodeURIComponent(address); 5 | 6 | 7 | request({ 8 | // below url is changed to this becoz to remove error of OVER_QUEUE_LIMIT 9 | /* 10 | check the following link 11 | http://links.mead.io/api-fix 12 | */ 13 | url:`http://www.mapquestapi.com/geocoding/v1/address?key=T30ZZg3ly00seypHNBA0eDrBa6Yam1AT&location=${encodedAddress}`, 14 | json: true 15 | },(error ,response,body)=>{ 16 | //console.log(body); 17 | if(error){ 18 | callback('Unable to connect to Google servers...'); 19 | 20 | 21 | }else if(body.info.statuscode === 400){ 22 | callback( 'Unable to find that address..'); 23 | 24 | } 25 | else if(body.info.statuscode === 0){ 26 | callback( { 27 | address: body.results[0].providedLocation.location, 28 | latitude : body.results[0].locations[0].latLng.lat, 29 | longitude: body.results[0].locations[0].latLng.lng 30 | }); 31 | // console.log(`Address :${body.results[0].providedLocation.location}`); 32 | // console.log(`latitude : ${body.results[0].locations[0].latLng.lat}`); 33 | // console.log(`longitude : ${body.results[0].locations[0].latLng.lng}`); 34 | } 35 | 36 | //console.log(response); 37 | //console.log(error); 38 | 39 | }); 40 | 41 | }; 42 | 43 | module.exports.geocodeAddress = geocodeAddress; -------------------------------------------------------------------------------- /PArt-1/app.js: -------------------------------------------------------------------------------- 1 | //Loading the modules 2 | //require is used to load the modules 3 | //it rety=urns the object that is exported 4 | 5 | 6 | 7 | /* 8 | * note logger here is var i.e it can be changed in further code 9 | 10 | * 11 | * var logger= require('./logger'); 12 | * 13 | * 14 | 15 | * so good practice to have const logger 16 | */ 17 | 18 | const logger= require('./logger'); 19 | console.log(logger); 20 | 21 | //now the module is loaded we can acces its memebers 22 | logger.log('messgae'); 23 | 24 | 25 | 26 | // using PATH module 27 | const path= require('path'); 28 | var pathobj=path.parse(__filename); 29 | console.log(pathobj); 30 | 31 | //iusing OS module 32 | const os= require('os'); 33 | var totalmem=os.totalmem(); 34 | var freemem=os.freemem(); 35 | 36 | console.log(totalmem); 37 | console.log(freemem); 38 | 39 | 40 | /* 41 | TEmplate String 42 | //ES6 / ES2015 : ECMA Script 6 / 2105 tells about feature of js 43 | */ 44 | console.log(`Total memory : ${totalmem}`); 45 | console.log(`free memory : ${freemem}`); 46 | 47 | 48 | 49 | 50 | /* 51 | * FILE MODULE 52 | 53 | */ 54 | const fs = require('fs'); 55 | const files = fs.readdirSync('./'); 56 | console.log(files); 57 | 58 | fs.readdir('./',function(err){ 59 | 60 | if(err) console.log('ERROR',err) 61 | else console.log('Result',files); 62 | 63 | 64 | }); 65 | 66 | /* 67 | EVENTS 68 | 69 | */ 70 | /* NOTE EventEmitter is a class*/ 71 | const EventEmitter = require('events'); 72 | const emitter = new EventEmitter(); 73 | 74 | /// register a lostener 75 | emitter.on('MessageLogged',function(arg){ 76 | 77 | console.log('LIStener Called',arg); 78 | }); 79 | 80 | 81 | 82 | // Rwaise an event 83 | emitter.emit('MessageLogged',{id:1,url:'http://'}) 84 | -------------------------------------------------------------------------------- /Weather-app/request download.txt: -------------------------------------------------------------------------------- 1 | PS I:\PROGRAM\Node.js\weather-app> npm init 2 | This utility will walk you through creating a package.json file.It only covers the most common items, and tries to guess sensible defaults. 3 | 4 | See `npm help json` for definitive documentation on these fieldsand exactly what they do. 5 | 6 | Use `npm install ` afterwards to install a package and 7 | save it as a dependency in the package.json file. 8 | 9 | Press ^C at any time to quit. 10 | package name: (weather-app)version: (1.0.0)description: 11 | entry point: (index.js)test command: 12 | git repository: 13 | keywords: 14 | author: 15 | license: (ISC) 16 | About to write to I:\PROGRAM\Node.js\weather-app\package.json: 17 | 18 | { 19 | "name": "weather-app", 20 | "version": "1.0.0", 21 | "description": "", 22 | "main": "index.js", 23 | "scripts": { 24 | "test": "echo \"Error: no test specified\" && exit 1" 25 | }, 26 | "author": "", "license": "ISC" 27 | } 28 | 29 | 30 | Is this OK? (yes) 31 | PS I:\PROGRAM\Node.js\weather-app> npm install request@2.88.0 --save 32 | 33 | 34 | PS I:\PROGRAM\Node.js\weather-app> node app.js 35 | { error_message: 36 | 'Keyless access to Google Maps Platform is deprecated. Please use an APIkey with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account', results: [], 37 | status: 'OVER_QUERY_LIMIT' } 38 | PS I:\PROGRAM\Node.js\weather-app> node app.js{ results: 39 | [ { address_components: [Array], 40 | formatted_address: '1301 Lombard St, Philadelphia, PA 19147, USA', geometry: [Object], 41 | place_id: 42 | 'EiwxMzAxIExvbWJhcmQgU3QsIFBoaWxhZGVscGhpYSwgUEEgMTkxNDcsIFVTQSIbEhkKFAoSCU38VoEkxsaJEedji1ij51aUEJUK', types: [Array] } ], status: 'OK' } 43 | PS I:\PROGRAM\Node.js\weather-app> -------------------------------------------------------------------------------- /Weather-app/playground/promise-2.js: -------------------------------------------------------------------------------- 1 | const request = require('request'); 2 | 3 | var geocodeAddress = (address) =>{ 4 | return new Promise((resolve,reject)=>{ 5 | var encodedAddress = encodeURIComponent(address); 6 | 7 | 8 | request({ 9 | // below url is changed to this becoz to remove error of OVER_QUEUE_LIMIT 10 | /* 11 | check the following link 12 | http://links.mead.io/api-fix 13 | */ 14 | url:`http://www.mapquestapi.com/geocoding/v1/address?key=T30ZZg3ly00seypHNBA0eDrBa6Yam1AT&location=${encodedAddress}`, 15 | json: true 16 | },(error ,response,body)=>{ 17 | //console.log(body); 18 | if(error){ 19 | reject('Unable to connect to Google servers...'); 20 | 21 | 22 | }else if(body.info.statuscode === 400){ 23 | reject( 'Unable to find that address..'); 24 | 25 | } 26 | else if(body.info.statuscode === 0){ 27 | resolve( { 28 | address: body.results[0].providedLocation.location, 29 | latitude : body.results[0].locations[0].latLng.lat, 30 | longitude: body.results[0].locations[0].latLng.lng 31 | }); 32 | // console.log(`Address :${body.results[0].providedLocation.location}`); 33 | // console.log(`latitude : ${body.results[0].locations[0].latLng.lat}`); 34 | // console.log(`longitude : ${body.results[0].locations[0].latLng.lng}`); 35 | } 36 | 37 | //console.log(response); 38 | //console.log(error); 39 | 40 | }); 41 | }); 42 | }; 43 | 44 | geocodeAddress('').then((location)=>{ 45 | console.log(JSON.stringify(location,undefined,2)); 46 | 47 | },(errorMessage)=>{ 48 | console.log(errorMessage); 49 | 50 | }); -------------------------------------------------------------------------------- /aynsc-await-node/app-promises.js: -------------------------------------------------------------------------------- 1 | const users = [{ 2 | id: 1, 3 | name: 'Andrew', 4 | schoolId: 101 5 | }, { 6 | id: 2, 7 | name: 'Jessica', 8 | schoolId: 999 9 | }]; 10 | 11 | const grades = [{ 12 | id: 1, 13 | schoolId: 101, 14 | grade: 86 15 | }, { 16 | id: 2, 17 | schoolId: 999, 18 | grade: 100 19 | }, { 20 | id: 3, 21 | schoolId: 101, 22 | grade: 80 23 | }]; 24 | 25 | const getUser = (id) => { 26 | return new Promise((resolve, reject) => { 27 | const user = users.find((user) => user.id === id); 28 | 29 | if (user) { 30 | resolve(user); 31 | } else { 32 | reject(`Unable to find user with id of ${id}.`); 33 | } 34 | }); 35 | }; 36 | 37 | const getGrades = (schoolId) => { 38 | return new Promise((resolve, reject) => { 39 | resolve(grades.filter((grade) => grade.schoolId === schoolId)); 40 | }); 41 | }; 42 | 43 | // Andrew has a 83% in the class 44 | const getStatus = (userId) => { 45 | let user; 46 | return getUser(userId).then((tempUser) => { 47 | user = tempUser; 48 | return getGrades(user.schoolId); 49 | }).then((grades) => { 50 | let average = 0; 51 | 52 | if (grades.length > 0) { 53 | average = grades.map((grade) => grade.grade).reduce((a, b) => a + b) / grades.length; 54 | } 55 | 56 | return `${user.name} has a ${average}% in the class.`; 57 | }); 58 | }; 59 | 60 | const getStatusAlt = async (userId) => { 61 | const user = await getUser(userId); 62 | const grades = await getGrades(user.schoolId); 63 | let average = 0; 64 | 65 | if (grades.length > 0) { 66 | average = grades.map((grade) => grade.grade).reduce((a, b) => a + b) / grades.length; 67 | } 68 | 69 | return `${user.name} has a ${average}% in the class.`; 70 | }; 71 | 72 | getStatusAlt(2).then((status) => { 73 | console.log(status); 74 | }).catch((e) => { 75 | console.log(e); 76 | }); 77 | 78 | // getStatus(123).then((status) => { 79 | // console.log(status); 80 | // }).catch((e) => { 81 | // console.log(e); 82 | // }); 83 | -------------------------------------------------------------------------------- /yargs/notes.js: -------------------------------------------------------------------------------- 1 | console.log('Starting notes.js'); 2 | const fs = require('fs'); 3 | //frtch notes 4 | var fetchNotes = () => { 5 | //jsut in case if file does not exist 6 | try{ 7 | var notesString=fs.readFileSync('notes-data.json'); 8 | return JSON.parse(notesString); 9 | }catch(e) 10 | { 11 | return []; 12 | } 13 | }; 14 | 15 | //save notes 16 | var saveNotes = (notes)=> { 17 | fs.writeFileSync('notes-data.json',JSON.stringify(notes)); 18 | }; 19 | 20 | var addNote = (title, body) => { 21 | var notes = fetchNotes(); 22 | var note ={ 23 | title, 24 | body 25 | }; 26 | 27 | var duplicatenodes =notes.filter((note)=> note.title === title ); 28 | if(duplicatenodes.length===0){ 29 | notes.push(note); 30 | saveNotes(notes); 31 | return note; 32 | } 33 | 34 | }; 35 | 36 | // function to get array of the notes 37 | var getAll = () => { 38 | //console.log('Getting all notes'); 39 | return fetchNotes(); 40 | 41 | }; 42 | 43 | var getNote = (title) => { 44 | //console.log('G etting note', title); 45 | 46 | //fetch notes 47 | var note = fetchNotes(); 48 | 49 | //filter 50 | var filterNotes =note.filter((note) =>note.title === title); 51 | 52 | // return 53 | return filterNotes[0]; 54 | 55 | 56 | 57 | }; 58 | 59 | var removeNote = (title) => { 60 | //console.log('Removing note', title); 61 | 62 | //fetch notes 63 | var notes =fetchNotes(); 64 | 65 | //filter notes , find the title named note 66 | var filterednotes = notes.filter( (note)=> note.title !==title); 67 | 68 | //update the notes ..save new nodes array 69 | saveNotes(filterednotes); 70 | 71 | //return true if note reurned ,else false 72 | return notes.length !== filterednotes.length; 73 | 74 | }; 75 | 76 | var logNote = (note) => 77 | { 78 | console.log('--'); 79 | console.log(`Title: ${note.title}`); 80 | console.log(`Body: ${note.body}`); 81 | }; 82 | 83 | module.exports = { 84 | addNote, 85 | getAll, 86 | getNote, 87 | removeNote, 88 | logNote 89 | }; 90 | -------------------------------------------------------------------------------- /yargs/app.js: -------------------------------------------------------------------------------- 1 | console.log('Starting app.js'); 2 | 3 | const fs = require('fs'); 4 | const _ = require('lodash'); 5 | const yargs = require('yargs'); 6 | 7 | const notes = require('./notes.js'); 8 | 9 | const titleOptions ={ 10 | describe:'title of note', 11 | demand : true, 12 | alias: 't' 13 | }; 14 | 15 | const bodyOptions={ 16 | describe:'body of note', 17 | demand:true, 18 | alias:'b' 19 | }; 20 | // Get the arguments as a plain old object. 21 | //const argv = yargs.argv; // it version of argumemwnts the app use 22 | const argv =yargs 23 | .command('add','Add a new Note',{ 24 | title: titleOptions, 25 | body: bodyOptions 26 | }) 27 | .command('list','List all notes') 28 | .command('read','Read a note',{ 29 | title: titleOptions, 30 | }) 31 | .command('remove','remove a note',{ 32 | title: titleOptions 33 | }) 34 | .help() 35 | .argv; 36 | var command = argv._[0]; 37 | //console.log('Command: ', command); 38 | //console.log('Yargs', argv); 39 | 40 | if (command === 'add') { 41 | var note=notes.addNote(argv.title, argv.body); 42 | if(note) 43 | { 44 | console.log('note Created'); 45 | notes.logNote(note); 46 | } 47 | else{ 48 | console.log('note title taken .. try again HOSS'); 49 | 50 | } 51 | } 52 | else if (command === 'list') 53 | { 54 | var allNotes = notes.getAll(); 55 | console.log(`Printing ${allNotes.length} note(s)`); 56 | 57 | allNotes.forEach((note) => notes.logNote(note)); 58 | 59 | } 60 | else if (command === 'read') 61 | { 62 | var note =notes.getNote(argv.title); 63 | if(note) 64 | { 65 | console.log('note Found'); 66 | notes.logNote(note); 67 | } 68 | else 69 | { 70 | console.log('NOte NOt FOunt'); 71 | 72 | } 73 | } 74 | else if (command === 'remove') 75 | { 76 | var noteremove=notes.removeNote(argv.title); 77 | var message = noteremove ? 'Note Removed':'Note Not Found'; 78 | console.log(message); 79 | 80 | 81 | } else { 82 | console.log('Command not recognized'); 83 | } 84 | -------------------------------------------------------------------------------- /Nodeman/nodeman.txt: -------------------------------------------------------------------------------- 1 | 2 | PS I:\PROGRAM\Node.js\FS-2> npm install nodemon -g 3 | C:\Users\lenovo\AppData\Roaming\npm\nodemon -> C:\Users\lenovo\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js 4 | 5 | > nodemon@1.18.4 postinstall C:\Users\lenovo\AppData\Roaming\npm\node_modules\nodemon 6 | > node bin/postinstall || exit 0 7 | 8 | Love nodemon? You can now support the project via the open collective: 9 | > https://opencollective.com/nodemon/donate 10 | 11 | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\nodemon\node_modules\fsevents): 12 | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 13 | 14 | + nodemon@1.18.4 15 | added 233 packages from 136 contributors in 33.337s 16 | PS I:\PROGRAM\Node.js\FS-2> nodemon 17 | [nodemon] 1.18.4 18 | [nodemon] to restart at any time, enter `rs` 19 | [nodemon] watching: *.* 20 | [nodemon] starting `node app.js` 21 | staring app... 22 | Starting notes.js.... 23 | AddNote 24 | New Note 25 | Result : 9.5 26 | false 27 | true 28 | [nodemon] clean exit - waiting for changes before restart 29 | ^CTerminate batch job (Y/N)? n 30 | PS I:\PROGRAM\Node.js\FS-2> nodemon app.js 31 | [nodemon] 1.18.4 32 | [nodemon] to restart at any time, enter `rs` 33 | [nodemon] watching: *.* 34 | [nodemon] starting `node app.js` 35 | staring app... 36 | Starting notes.js.... 37 | AddNote 38 | New Note 39 | Result : 9.5 40 | false 41 | true 42 | [nodemon] clean exit - waiting for changes before restart 43 | [nodemon] restarting due to changes... 44 | [nodemon] starting `node app.js` 45 | staring app... 46 | Starting notes.js.... 47 | AddNote 48 | New Note 49 | Result : 9.5 50 | false 51 | true 52 | [nodemon] clean exit - waiting for changes before restart 53 | [nodemon] restarting due to changes... 54 | [nodemon] starting `node app.js` 55 | staring app... 56 | Starting notes.js.... 57 | AddNote 58 | New Note 59 | Result : 9.5 60 | true 61 | true 62 | [nodemon] clean exit - waiting for changes before restart 63 | [nodemon] restarting due to changes... 64 | [nodemon] starting `node app.js` 65 | staring app... 66 | Starting notes.js.... 67 | AddNote 68 | New Note 69 | Result : 9.5 70 | false 71 | true 72 | [nodemon] clean exit - waiting for changes before restart -------------------------------------------------------------------------------- /Weather-app/app-promise.js: -------------------------------------------------------------------------------- 1 | const yargs = require('yargs'); 2 | const axios = require('axios'); 3 | 4 | const argv = yargs 5 | .options({ 6 | a: { 7 | demand: true, 8 | alias: 'address', 9 | describe: 'Address to fetch weather for', 10 | string: true 11 | } 12 | }) 13 | .help() 14 | .alias('help', 'h') 15 | .argv; 16 | 17 | var defaultAddress = "pune"; 18 | var encodedAddress = encodeURIComponent(argv.address || defaultAddress); 19 | var geocodeUrl = `https://maps.googleapis.com/maps/api/geocode/json?address=${encodedAddress}`; 20 | 21 | 22 | axios.get(geocodeUrl).then((response) => { 23 | if (response.data.status === 'ZERO_RESULTS') { 24 | throw new Error('Unable to find that address.'); 25 | } 26 | 27 | var lat = response.data.results[0].geometry.location.lat; 28 | var lng = response.data.results[0].geometry.location.lng; 29 | var weatherUrl = `https://api.darksky.net/forecast/c9ea14a026c159bb5ecb6848b0ea492f/${lat},${lng}`; 30 | 31 | console.log(response.data.results[0].formatted_address); 32 | return axios.get(weatherUrl); 33 | 34 | }).then((response) => { 35 | var temperature = response.data.currently.temperature; 36 | var apparentTemperature = response.data.currently.apparentTemperature; 37 | var humidity = response.data.currently.humidity; 38 | var precipProb = response.data.currently.precipProbability; 39 | console.log(`It's currently ${temperature}. It feels like ${apparentTemperature}.`); 40 | console.log(`It also seems to rain since humidity is ${humidity}..`); 41 | 42 | if (precipProb === 0){ 43 | precipProb = "Don't worry! It's not raining anytime soon"; 44 | } 45 | else{ 46 | precipProb = "Brace yourself for a rainy day"; 47 | } 48 | var wearWhat = ''; 49 | if (apparentTemperature > 70){ 50 | wearWhat = "It's nice outside! Wear something light and summer-y :)" 51 | } 52 | else if (apparentTemperature>60 && apparentTemperature<70){ 53 | wearWhat = "Look classy ;) It's pleasant outside" 54 | } 55 | else { 56 | wearWhat = "Wear a jacket duuuude!" 57 | } 58 | }).catch((e) => { 59 | if (e.code === 'ENOTFOUND') { 60 | console.log('Unable to connect to API servers.'); 61 | } else { 62 | console.log(e.message); 63 | } 64 | }); 65 | 66 | //console.log('Loading weather info...'); -------------------------------------------------------------------------------- /Weather-app/playground/promise.js: -------------------------------------------------------------------------------- 1 | //this is to learn ES6 in node 2 | 3 | 4 | var asyncAdd = (a,b) => { 5 | return new Promise((resolve,reject)=>{ 6 | setTimeout(() => { 7 | if(typeof a === 'number' && typeof b ==='number') 8 | resolve(a+b); 9 | else{ 10 | reject('Arguments must be numbers..'); 11 | } 12 | }, 1500); 13 | }); 14 | }; 15 | /* this is chaining of two promises 16 | it is error in it if condition at 1st promises fails 17 | it prints error of it and continue to next */ 18 | 19 | // asyncAdd(5,'7').then((res)=>{ 20 | // console.log('Result : '+res); 21 | // return asyncAdd(res,33); 22 | // },(errorMessage)=>{ 23 | // console.log(errorMessage); 24 | 25 | // }).then((res)=>{ 26 | // console.log('Should be 45:'+res); 27 | 28 | // },(errorMessage)=>{ 29 | // console.log(errorMessage); 30 | 31 | // }); 32 | 33 | 34 | /** the above issue is resolved in following */ 35 | asyncAdd(5,'7').then((res)=>{ 36 | console.log('Result : '+res); 37 | return asyncAdd(res,33); 38 | }).then((res)=>{ 39 | console.log('Should be 45:'+res); 40 | 41 | }).catch((errorMessage)=>{ 42 | //here catch is used to handle all error of promises 43 | console.log(errorMessage); 44 | 45 | }); 46 | 47 | 48 | // request library does not support promise // 49 | /******************************************************** */ 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | var somePromise = new Promise((resolve , reject) =>{ 62 | 63 | // here the "promise" in state of "pending" 64 | setTimeout(() => { 65 | 66 | /* 67 | you can resolve once 68 | or you can reject once 69 | not both together or twice 70 | */ 71 | resolve('hey It worked!'); 72 | reject('unable to Fulfill promise'); 73 | 74 | //after this the promise state i "Settle" 75 | }, 2500); 76 | 77 | 78 | }); 79 | 80 | //if the promise is resolved or rejected then what to do ....... 81 | somePromise.then((message)=>{ 82 | // if the promise successed to resolve .... do this .. here there can be funcrtion call 83 | console.log('Success ' + message); 84 | 85 | },(errorMessage) =>{ 86 | // if rejected 87 | console.log('Error : ' + errorMessage); 88 | 89 | }); -------------------------------------------------------------------------------- /hostel Management/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const hbs = require('hbs'); 3 | const fs =require('fs'); 4 | 5 | //for dynamic port allocation 6 | const port =process.env.PORT || 3000; 7 | 8 | // create an app 9 | var app = express(); 10 | 11 | //for setting up template for pages 12 | //hbs.registerPartials(__dirname + '/views/partials'); 13 | 14 | //set up a view engine 15 | app.set('view engine','hbs'); 16 | 17 | //middleware ---- lets you configure express to work like to your way 18 | /* logiing to screen 19 | api authetication 20 | write header is sent 21 | respont to a request -- resppoonse.render response.sent 22 | whether logded in and give access to him*/ 23 | 24 | 25 | // next for next thing to do 26 | // app.use((req,res,next)=>{ 27 | // var now = new Date().toString(); 28 | // //creating LOGGER 29 | // var log = `${now}: + ${req.method} ${req.url}`; 30 | // console.log(log); 31 | // fs.appendFile('server.log',log + '\n',(err)=>{ 32 | // if(err){ 33 | // console.log('Unable to Append to server.log'); 34 | // } 35 | // }); 36 | 37 | // next(); 38 | // }); 39 | 40 | // app.use((req,res,next)=>{ 41 | // res.render('maintenance.hbs'); 42 | // }); 43 | 44 | app.use(express.static(__dirname + '/public')); 45 | 46 | app.use(express.static(__dirname + '/views')); 47 | 48 | //register helper of hbs 49 | hbs.registerHelper('getCurrentYear',()=>{ 50 | return new Date().getFullYear(); 51 | }); 52 | //helper with arguemets 53 | hbs.registerHelper('screamIt',(text)=>{ 54 | return text.toUpperCase(); 55 | }); 56 | 57 | //setting up http routehandler 58 | app.get('/',(req,res)=>{ 59 | 60 | res.render('login.hbs',{ 61 | pageTitle:'Home Page', 62 | welcomeMessage:'welcome to my website' 63 | }); 64 | //res.send('

Hello Express!

'); 65 | // res.send({ 66 | // name:'Ashlesh', 67 | // likes:[ 68 | // 'biking', 69 | // 'hiking', 70 | // 'sleeping' 71 | // ] 72 | // }) 73 | }); 74 | 75 | app.get('/about',(req,res) =>{ 76 | res.render('dashboard.hbs',{ 77 | pageTitle:'dashboard page' 78 | }); 79 | }); 80 | 81 | app.get('/bad',(req,res) =>{ 82 | res.send({ 83 | error:'could not load page' 84 | }); 85 | }); 86 | 87 | //an default port no set here with a function server is up ... do something 88 | app.listen(port,()=>{ 89 | console.log(`Server is Up on port ${port}`); 90 | 91 | }); -------------------------------------------------------------------------------- /node-web-server/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const hbs = require('hbs'); 3 | const fs =require('fs'); 4 | 5 | //for dynamic port allocation 6 | const port =process.env.PORT || 3000; 7 | // create an app 8 | var app = express(); 9 | 10 | //for setting up template for pages 11 | hbs.registerPartials(__dirname + '/views/partials'); 12 | 13 | //set up a view engine 14 | app.set('view engine','hbs'); 15 | 16 | //middleware ---- lets you configure express to work like to your way 17 | /* logiing to screen 18 | api authetication 19 | write header is sent 20 | respont to a request -- resppoonse.render response.sent 21 | whether logded in and give access to him*/ 22 | 23 | 24 | // next for next thing to do 25 | app.use((req,res,next)=>{ 26 | var now = new Date().toString(); 27 | //creating LOGGER 28 | var log = `${now}: + ${req.method} ${req.url}`; 29 | console.log(log); 30 | fs.appendFile('server.log',log + '\n',(err)=>{ 31 | if(err){ 32 | console.log('Unable to Append to server.log'); 33 | } 34 | }); 35 | 36 | next(); 37 | }); 38 | 39 | // app.use((req,res,next)=>{ 40 | // res.render('maintenance.hbs'); 41 | // }); 42 | 43 | app.use(express.static(__dirname + '/public')); 44 | 45 | 46 | //register helper of hbs 47 | hbs.registerHelper('getCurrentYear',()=>{ 48 | return new Date().getFullYear(); 49 | }); 50 | //helper with arguemets 51 | hbs.registerHelper('screamIt',(text)=>{ 52 | return text.toUpperCase(); 53 | }); 54 | 55 | //setting up http routehandler 56 | app.get('/',(req,res)=>{ 57 | 58 | res.render('home.hbs',{ 59 | pageTitle:'Home Page', 60 | welcomeMessage:'welcome to my website' 61 | }); 62 | //res.send('

Hello Express!

'); 63 | // res.send({ 64 | // name:'Ashlesh', 65 | // likes:[ 66 | // 'biking', 67 | // 'hiking', 68 | // 'sleeping' 69 | // ] 70 | // }) 71 | }); 72 | 73 | app.get('/about',(req,res) =>{ 74 | res.render('about.hbs',{ 75 | pageTitle:'about page' 76 | }); 77 | }); 78 | 79 | app.get('/projects',(req,res) =>{ 80 | res.render('projects.hbs',{ 81 | pageTitle:'Projects page' 82 | }); 83 | }); 84 | 85 | app.get('/bad',(req,res) =>{ 86 | res.send({ 87 | error:'could not load page' 88 | }); 89 | }); 90 | 91 | //an default port no set here with a function server is up ... do something 92 | app.listen(port,()=>{ 93 | console.log(`Server is Up on port ${port}`); 94 | 95 | }); -------------------------------------------------------------------------------- /node-tests/utils/utils.test.js: -------------------------------------------------------------------------------- 1 | const utils =require('./utils'); 2 | const expect =require('expect'); 3 | 4 | 5 | describe('Utils',()=>{ 6 | 7 | it('should add two numbers',()=>{ 8 | var result = utils.add(33,11); 9 | // if(result !==44){ 10 | // throw new Error(`Expected 44 but got ${result}`); 11 | // } 12 | expect(result).toBe(44).toBeA('number'); 13 | }); 14 | 15 | 16 | // to test the async test case 17 | // done is used to tell mocha that this is async test......it 18 | //will not test this until done is called 19 | 20 | it('should aync add two numbers',(done)=>{ 21 | utils.asyncAdd(4,3,(sum)=>{ 22 | expect(sum).toBe(7).toBeA('number'); 23 | 24 | //call done after assertion 25 | done(); 26 | }); 27 | }); 28 | // aync square 29 | 30 | it('should async sqaure numbers',(done)=>{ 31 | utils.asyncsquare(4,(sum)=>{ 32 | expect(sum).toBe(16).toBeA('number'); 33 | 34 | //call done after assertion 35 | done(); 36 | }); 37 | }); 38 | ////////////////////////////////////////////// 39 | 40 | it('should square a number ',()=>{ 41 | var result = utils.square(4); 42 | // if(result !==16){ 43 | // throw new Error(`Expected 16 but got ${result}`); 44 | // } 45 | expect(result).toBe(16).toBeA('number'); 46 | 47 | }); 48 | }); 49 | 50 | it('shoul set first name and last name',()=>{ 51 | var user ={location: 'pune',age:21}; 52 | var res = utils.setname(user,'Ashlesh Khajbage'); 53 | 54 | 55 | expect(res).toInclude({ 56 | firstname:'Ashlesh', 57 | Lastname:'Khajbage' 58 | }) 59 | }); 60 | 61 | // describe used for making readalbity of test(s) 62 | var assert = require('assert'); 63 | describe('Array', function() { 64 | describe('#indexOf()', function() { //#sign+method is convetion used 65 | it('should return -1 when the value is not present', function() { 66 | assert.equal([1,2,3].indexOf(4), -1); 67 | }); 68 | }); 69 | }); 70 | 71 | it('double done', function(done) { 72 | // Calling `done()` twice is an error 73 | setImmediate(done); 74 | // setImmediate(done); 75 | }); 76 | 77 | it('should expect some value',()=>{ 78 | //expect(12).toNotBe(13); 79 | // expect({name:'Ashlesh'}).toBe({name:'Ashlesh'}); 80 | //expect({name:'Ashlesh'}).toEqual({name:'Ashlesh'}); 81 | 82 | //include property 83 | //expect([1,2,3]).toInclude(2).toExclude(5); 84 | 85 | expect({ 86 | name:'Ashlesh', 87 | age:21, 88 | location:'pune' 89 | }).toInclude({ 90 | age:21 91 | }); 92 | }); 93 | 94 | 95 | -------------------------------------------------------------------------------- /node-todo-api/server/models/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const validator = require('validator'); 3 | const jwt = require('jsonwebtoken'); 4 | const _ = require('lodash'); 5 | const bcrypt = require('bcryptjs'); 6 | 7 | var UserSchema = new mongoose.Schema({ 8 | email: { 9 | type: String, 10 | required: true, 11 | trim: true, 12 | minlength: 1, 13 | unique: true, 14 | validate: { 15 | validator: validator.isEmail, 16 | message: '{VALUE} is not a valid email' 17 | } 18 | }, 19 | password: { 20 | type: String, 21 | require: true, 22 | minlength: 6 23 | }, 24 | tokens: [{ 25 | access: { 26 | type: String, 27 | required: true 28 | }, 29 | token: { 30 | type: String, 31 | required: true 32 | } 33 | }] 34 | }); 35 | 36 | UserSchema.methods.toJSON = function () { 37 | var user = this; 38 | var userObject = user.toObject(); 39 | 40 | return _.pick(userObject, ['_id', 'email']); 41 | }; 42 | 43 | UserSchema.methods.generateAuthToken = function () { 44 | var user = this; 45 | var access = 'auth'; 46 | var token = jwt.sign({_id: user._id.toHexString(), access}, process.env.JWT_SECRET).toString(); 47 | 48 | //user.tokens.push({access, token}); //if it does not work..then line below 49 | user.tokens=user.tokens.concat([{access, token}]); 50 | 51 | return user.save().then(() => { 52 | return token; 53 | }); 54 | }; 55 | 56 | UserSchema.methods.removeToken = function (token) { 57 | var user = this; 58 | 59 | return user.update({ 60 | $pull: { 61 | tokens: {token} 62 | } 63 | }); 64 | }; 65 | 66 | UserSchema.statics.findByToken = function (token) { 67 | var User = this; 68 | var decoded; 69 | 70 | try { 71 | decoded = jwt.verify(token, process.env.JWT_SECRET); 72 | } catch (e) { 73 | return Promise.reject(); 74 | } 75 | 76 | return User.findOne({ 77 | '_id': decoded._id, 78 | 'tokens.token': token, 79 | 'tokens.access': 'auth' 80 | }); 81 | }; 82 | 83 | UserSchema.statics.findByCredentials = function (email, password) { 84 | var User = this; 85 | 86 | return User.findOne({email}).then((user) => { 87 | if (!user) { 88 | return Promise.reject(); 89 | } 90 | 91 | return new Promise((resolve, reject) => { 92 | // Use bcrypt.compare to compare password and user.password 93 | bcrypt.compare(password, user.password, (err, res) => { 94 | if (res) { 95 | resolve(user); 96 | } else { 97 | reject(); 98 | } 99 | }); 100 | }); 101 | }); 102 | }; 103 | 104 | UserSchema.pre('save', function (next) { 105 | var user = this; 106 | 107 | if (user.isModified('password')) { 108 | bcrypt.genSalt(10, (err, salt) => { 109 | bcrypt.hash(user.password, salt, (err, hash) => { 110 | user.password = hash; 111 | next(); 112 | }); 113 | }); 114 | } else { 115 | next(); 116 | } 117 | }); 118 | 119 | var User = mongoose.model('User', UserSchema); 120 | 121 | module.exports = {User} 122 | -------------------------------------------------------------------------------- /hostel Management/views/login.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 |
26 |
27 | 76 |
77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /node-chat-app/public/js/chat.js: -------------------------------------------------------------------------------- 1 | // var socket = io(); 2 | 3 | // socket.on('connect',function(){ 4 | // console.log('Connected to server'); 5 | 6 | // }); 7 | 8 | 9 | // socket.on('disconnect',function(){ 10 | // console.log('DisConnected to server'); 11 | 12 | // }); 13 | // function scrollToBottom () { 14 | // // Selectors 15 | // var messages = jQuery('#messages'); 16 | // var newMessage = messages.children('li:last-child') 17 | // // Heights 18 | // var clientHeight = messages.prop('clientHeight'); 19 | // var scrollTop = messages.prop('scrollTop'); 20 | // var scrollHeight = messages.prop('scrollHeight'); 21 | // var newMessageHeight = newMessage.innerHeight(); 22 | // var lastMessageHeight = newMessage.prev().innerHeight(); 23 | 24 | // if (clientHeight + scrollTop + newMessageHeight + lastMessageHeight >= scrollHeight) { 25 | // messages.scrollTop(scrollHeight); 26 | // } 27 | // } 28 | 29 | // socket.on('connect', function () { 30 | // var params = jQuery.deparam(window.location.search); 31 | 32 | // socket.emit('join', params, function (err) { 33 | // if (err) { 34 | // alert(err); 35 | // window.location.href = '/'; 36 | // } else { 37 | // console.log('No error'); 38 | // } 39 | // }); 40 | // }); 41 | 42 | // socket.on('disconnect', function () { 43 | // console.log('Disconnected from server'); 44 | // }); 45 | 46 | // socket.on('updateUserList', function (users) { 47 | // var ol = jQuery('
    '); 48 | 49 | // users.forEach(function (user) { 50 | // ol.append(jQuery('
  1. ').text(user)); 51 | // }); 52 | 53 | // jQuery('#users').html(ol); 54 | // }); 55 | 56 | // socket.on('newMessage', function (message) { 57 | // var formattedTime = moment(message.createdAt).format('h:mm a'); 58 | // var template = jQuery('#message-template').html(); 59 | // var html = Mustache.render(template, { 60 | // text: message.text, 61 | // from: message.from, 62 | // createdAt: formattedTime 63 | // }); 64 | 65 | // jQuery('#messages').append(html); 66 | // scrollToBottom(); 67 | // }); 68 | 69 | // socket.on('newLocationMessage', function (message) { 70 | // var formattedTime = moment(message.createdAt).format('h:mm a'); 71 | // var template = jQuery('#location-message-template').html(); 72 | // var html = Mustache.render(template, { 73 | // from: message.from, 74 | // url: message.url, 75 | // createdAt: formattedTime 76 | // }); 77 | 78 | // jQuery('#messages').append(html); 79 | // scrollToBottom(); 80 | // }); 81 | 82 | // jQuery('#message-form').on('submit', function (e) { 83 | // e.preventDefault(); 84 | 85 | // var messageTextbox = jQuery('[name=message]'); 86 | 87 | // socket.emit('createMessage', { 88 | // text: messageTextbox.val() 89 | // }, function () { 90 | // messageTextbox.val('') 91 | // }); 92 | // }); 93 | 94 | // var locationButton = jQuery('#send-location'); 95 | // locationButton.on('click', function () { 96 | // if (!navigator.geolocation) { 97 | // return alert('Geolocation not supported by your browser.'); 98 | // } 99 | 100 | // locationButton.attr('disabled', 'disabled').text('Sending location...'); 101 | 102 | // navigator.geolocation.getCurrentPosition(function (position) { 103 | // locationButton.removeAttr('disabled').text('Send location'); 104 | // socket.emit('createLocationMessage', { 105 | // latitude: position.coords.latitude, 106 | // longitude: position.coords.longitude 107 | // }); 108 | // }, function () { 109 | // locationButton.removeAttr('disabled').text('Send location'); 110 | // alert('Unable to fetch location.'); 111 | // }); 112 | // }); 113 | -------------------------------------------------------------------------------- /node-todo-api/server/server.js: -------------------------------------------------------------------------------- 1 | require('./config/config'); 2 | 3 | const _ = require('lodash'); 4 | const express = require('express'); 5 | const bodyParser = require('body-parser'); 6 | const {ObjectID} = require('mongodb'); 7 | 8 | var {mongoose} = require('./db/mongoose'); 9 | var {Todo} = require('./models/todo'); 10 | var {User} = require('./models/user'); 11 | var {authenticate} = require('./middleware/authenticate'); 12 | 13 | var app = express(); 14 | const port = process.env.PORT; 15 | 16 | app.use(bodyParser.json()); 17 | 18 | app.post('/todos', authenticate, (req, res) => { 19 | var todo = new Todo({ 20 | text: req.body.text, 21 | _creator: req.user._id 22 | }); 23 | 24 | todo.save().then((doc) => { 25 | res.send(doc); 26 | }, (e) => { 27 | res.status(400).send(e); 28 | }); 29 | }); 30 | 31 | app.get('/todos', authenticate, (req, res) => { 32 | Todo.find({ 33 | _creator: req.user._id 34 | }).then((todos) => { 35 | res.send({todos}); 36 | }, (e) => { 37 | res.status(400).send(e); 38 | }); 39 | }); 40 | 41 | app.get('/todos/:id', authenticate, (req, res) => { 42 | var id = req.params.id; 43 | 44 | if (!ObjectID.isValid(id)) { 45 | return res.status(404).send(); 46 | } 47 | 48 | Todo.findOne({ 49 | _id: id, 50 | _creator: req.user._id 51 | }).then((todo) => { 52 | if (!todo) { 53 | return res.status(404).send(); 54 | } 55 | 56 | res.send({todo}); 57 | }).catch((e) => { 58 | res.status(400).send(); 59 | }); 60 | }); 61 | 62 | app.delete('/todos/:id', authenticate, (req, res) => { 63 | var id = req.params.id; 64 | 65 | if (!ObjectID.isValid(id)) { 66 | return res.status(404).send(); 67 | } 68 | 69 | Todo.findOneAndRemove({ 70 | _id: id, 71 | _creator: req.user._id 72 | }).then((todo) => { 73 | if (!todo) { 74 | return res.status(404).send(); 75 | } 76 | 77 | res.send({todo}); 78 | }).catch((e) => { 79 | res.status(400).send(); 80 | }); 81 | }); 82 | 83 | app.patch('/todos/:id', authenticate, (req, res) => { 84 | var id = req.params.id; 85 | var body = _.pick(req.body, ['text', 'completed']); 86 | 87 | if (!ObjectID.isValid(id)) { 88 | return res.status(404).send(); 89 | } 90 | 91 | if (_.isBoolean(body.completed) && body.completed) { 92 | body.completedAt = new Date().getTime(); 93 | } else { 94 | body.completed = false; 95 | body.completedAt = null; 96 | } 97 | 98 | Todo.findOneAndUpdate({_id: id, _creator: req.user._id}, {$set: body}, {new: true}).then((todo) => { 99 | if (!todo) { 100 | return res.status(404).send(); 101 | } 102 | 103 | res.send({todo}); 104 | }).catch((e) => { 105 | res.status(400).send(); 106 | }) 107 | }); 108 | 109 | // POST /users 110 | app.post('/users', (req, res) => { 111 | var body = _.pick(req.body, ['email', 'password']); 112 | var user = new User(body); 113 | 114 | // user.save().then((user)=>{ 115 | // res.send(user); 116 | // }).catch((e)=>{ 117 | // res.status(400).send(e); 118 | // }); 119 | user.save().then(() => { 120 | return user.generateAuthToken(); 121 | }).then((token) => { 122 | res.header('x-auth', token).send(user); 123 | }).catch((e) => { 124 | res.status(400).send(e); 125 | }) 126 | }); 127 | 128 | app.get('/users/me', authenticate, (req, res) => { 129 | res.send(req.user); 130 | }); 131 | 132 | app.post('/users/login', (req, res) => { 133 | var body = _.pick(req.body, ['email', 'password']); 134 | 135 | User.findByCredentials(body.email, body.password).then((user) => { 136 | return user.generateAuthToken().then((token) => { 137 | res.header('x-auth', token).send(user); 138 | }); 139 | }).catch((e) => { 140 | res.status(400).send(); 141 | }); 142 | }); 143 | 144 | app.delete('/users/me/token', authenticate, (req, res) => { 145 | req.user.removeToken(req.token).then(() => { 146 | res.status(200).send(); 147 | }, () => { 148 | res.status(400).send(); 149 | }); 150 | }); 151 | 152 | app.listen(port, () => { 153 | console.log(`Started up at port ${port}`); 154 | }); 155 | 156 | module.exports = {app}; -------------------------------------------------------------------------------- /uploading app to heroku.txt: -------------------------------------------------------------------------------- 1 | 2 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 3 | $ git status 4 | On branch master 5 | Your branch is up to date with 'origin/master'. 6 | 7 | Changes not staged for commit: 8 | (use "git add ..." to update what will be committed) 9 | (use "git checkout -- ..." to discard changes in working directory) 10 | 11 | modified: package.json 12 | modified: server.js 13 | 14 | no changes added to commit (use "git add" and/or "git commit -a") 15 | 16 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 17 | $ git add . 18 | warning: LF will be replaced by CRLF in package.json. 19 | The file will have its original line endings in your working directory 20 | 21 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 22 | $ git status 23 | On branch master 24 | Your branch is up to date with 'origin/master'. 25 | 26 | Changes to be committed: 27 | (use "git reset HEAD ..." to unstage) 28 | 29 | modified: package.json 30 | modified: server.js 31 | 32 | 33 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 34 | $ git commit -m 'Setup start Scripy and heruku port' 35 | [master 64d6bf0] Setup start Scripy and heruku port 36 | 2 files changed, 7 insertions(+), 3 deletions(-) 37 | 38 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 39 | $ git push 40 | Enumerating objects: 7, done. 41 | Counting objects: 100% (7/7), done. 42 | Delta compression using up to 4 threads 43 | Compressing objects: 100% (4/4), done. 44 | Writing objects: 100% (4/4), 596 bytes | 596.00 KiB/s, done. 45 | Total 4 (delta 2), reused 0 (delta 0) 46 | remote: Resolving deltas: 100% (2/2), completed with 2 local objects. 47 | To https://github.com/Ashleshk/node-course-2-web-server.git 48 | 22e4a48..64d6bf0 master -> master 49 | 50 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 51 | $ heruko create 52 | bash: heruko: command not found 53 | 54 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 55 | $ heroko create 56 | bash: heroko: command not found 57 | 58 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 59 | $ heroku create 60 | Creating app... done, stormy-journey-30361 61 | https://stormy-journey-30361.herokuapp.com/ | https://git.heroku.com/stormy-journey-30361.git 62 | 63 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 64 | $ git push heroku 65 | Enumerating objects: 18, done. 66 | Counting objects: 100% (18/18), done. 67 | Delta compression using up to 4 threads 68 | Compressing objects: 100% (16/16), done. 69 | Writing objects: 100% (18/18), 2.87 KiB | 733.00 KiB/s, done. 70 | Total 18 (delta 5), reused 0 (delta 0) 71 | remote: Compressing source files... done. 72 | remote: Building source: 73 | remote: 74 | remote: -----> Node.js app detected 75 | remote: 76 | remote: -----> Creating runtime environment 77 | remote: 78 | remote: NPM_CONFIG_LOGLEVEL=error 79 | remote: NODE_ENV=production 80 | remote: NODE_MODULES_CACHE=true 81 | remote: NODE_VERBOSE=false 82 | remote: 83 | remote: -----> Installing binaries 84 | remote: engines.node (package.json): unspecified 85 | remote: engines.npm (package.json): unspecified (use default) 86 | remote: 87 | remote: Resolving node version 8.x... 88 | remote: Downloading and installing node 8.12.0... 89 | remote: Using default npm version: 6.4.1 90 | remote: 91 | remote: -----> Building dependencies 92 | remote: Installing node modules (package.json) 93 | remote: added 77 packages from 111 contributors and audited 151 packages in 3.138s 94 | remote: found 0 vulnerabilities 95 | remote: 96 | remote: 97 | remote: -----> Caching build 98 | remote: - node_modules 99 | remote: 100 | remote: -----> Pruning devDependencies 101 | remote: audited 151 packages in 1.311s 102 | remote: found 0 vulnerabilities 103 | remote: 104 | remote: 105 | remote: -----> Build succeeded! 106 | remote: -----> Discovering process types 107 | remote: Procfile declares types -> (none) 108 | remote: Default types for buildpack -> web 109 | remote: 110 | remote: -----> Compressing... 111 | remote: Done: 18M 112 | remote: -----> Launching... 113 | remote: Released v3 114 | remote: https://stormy-journey-30361.herokuapp.com/ deployed to Heroku 115 | remote: 116 | remote: Verifying deploy... done. 117 | To https://git.heroku.com/stormy-journey-30361.git 118 | * [new branch] master -> master 119 | 120 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 121 | $ ^C 122 | 123 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 124 | $ heroku open 125 | 126 | -------------------------------------------------------------------------------- /after login check for keys and deploy git app to heriku.txt: -------------------------------------------------------------------------------- 1 | 2 | I:\PROGRAM\Node.js\node-web-server>heroku login 3 | heroku: Enter your login credentials 4 | Email [ashleshuk@gmail.com]: 5 | Password: *********** 6 | Logged in as ashleshuk@gmail.com 7 | 8 | I:\PROGRAM\Node.js\node-web-server>heroku keys:add 9 | Found an SSH public key at C:\Users\lenovo\.ssh\id_rsa.pub 10 | ? Would you like to upload it to Heroku? Yes 11 | Uploading C:\Users\lenovo\.ssh\id_rsa.pub SSH key... done 12 | 13 | I:\PROGRAM\Node.js\node-web-server>heroku keys 14 | === ashleshuk@gmail.com keys 15 | ssh-rsa AAAAB3NzaC...2AgAYq0Q== ashleshuk@gmail.com 16 | 17 | I:\PROGRAM\Node.js\node-web-server>ssh -v git@heroku.com 18 | OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4 19 | debug1: Connecting to heroku.com [50.19.85.154] port 22. 20 | debug1: Connection established. 21 | debug1: identity file C:\\Users\\lenovo/.ssh/id_rsa type 0 22 | debug1: key_load_public: No such file or directory 23 | debug1: identity file C:\\Users\\lenovo/.ssh/id_rsa-cert type -1 24 | debug1: key_load_public: No such file or directory 25 | debug1: identity file C:\\Users\\lenovo/.ssh/id_dsa type -1 26 | debug1: key_load_public: No such file or directory 27 | debug1: identity file C:\\Users\\lenovo/.ssh/id_dsa-cert type -1 28 | debug1: key_load_public: No such file or directory 29 | debug1: identity file C:\\Users\\lenovo/.ssh/id_ecdsa type -1 30 | debug1: key_load_public: No such file or directory 31 | debug1: identity file C:\\Users\\lenovo/.ssh/id_ecdsa-cert type -1 32 | debug1: key_load_public: No such file or directory 33 | debug1: identity file C:\\Users\\lenovo/.ssh/id_ed25519 type -1 34 | debug1: key_load_public: No such file or directory 35 | debug1: identity file C:\\Users\\lenovo/.ssh/id_ed25519-cert type -1 36 | debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.6 37 | debug1: Remote protocol version 2.0, remote software version endosome 38 | debug1: no match: endosome 39 | debug1: Authenticating to heroku.com:22 as 'git' 40 | debug1: SSH2_MSG_KEXINIT sent 41 | debug1: SSH2_MSG_KEXINIT received 42 | debug1: kex: algorithm: curve25519-sha256@libssh.org 43 | debug1: kex: host key algorithm: ssh-rsa 44 | debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none 45 | debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none 46 | debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 47 | debug1: Server host key: ssh-rsa SHA256:8tF0wX2WquK45aGKs/Bh1dKmBXH08vxUe0VCJJWOA/o 48 | debug1: read_passphrase: can't open /dev/tty: No such file or directory 49 | The authenticity of host 'heroku.com (50.19.85.154)' can't be established. 50 | RSA key fingerprint is SHA256:8tF0wX2WquK45aGKs/Bh1dKmBXH08vxUe0VCJJWOA/o. 51 | Are you sure you want to continue connecting (yes/no)? yes 52 | Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts. 53 | debug1: rekey after 134217728 blocks 54 | debug1: SSH2_MSG_NEWKEYS sent 55 | debug1: expecting SSH2_MSG_NEWKEYS 56 | debug1: SSH2_MSG_NEWKEYS received 57 | debug1: rekey after 134217728 blocks 58 | debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory 59 | debug1: SSH2_MSG_SERVICE_ACCEPT received 60 | debug1: Authentications that can continue: publickey 61 | debug1: Next authentication method: publickey 62 | debug1: Offering public key: RSA SHA256:tW9tK+PxlJDG1yY6CaKPRzsbNJwWNOuTLVsXUpwGjM4 C:\\Users\\lenovo/.ssh/id_rsa 63 | debug1: Server accepts key: pkalg ssh-rsa blen 535 64 | debug1: Authentication succeeded (publickey). 65 | Authenticated to heroku.com ([50.19.85.154]:22). 66 | debug1: channel 0: new [client-session] 67 | debug1: Entering interactive session. 68 | debug1: pledge: network 69 | debug1: console supports the ansi parsing 70 | PTY allocation request failed on channel 0 71 | shell request failed on channel 0 72 | 73 | I:\PROGRAM\Node.js\node-web-server>SET 74 | ALLUSERSPROFILE=C:\ProgramData 75 | APPDATA=C:\Users\lenovo\AppData\Roaming 76 | CommonProgramFiles=C:\Program Files\Common Files 77 | CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files 78 | CommonProgramW6432=C:\Program Files\Common Files 79 | COMPUTERNAME=DESKTOP-27NLM5S 80 | ComSpec=C:\WINDOWS\system32\cmd.exe 81 | DriverData=C:\Windows\System32\Drivers\DriverData 82 | GDAL_DATA=C:\Program Files\PostgreSQL\9.5\gdal-data 83 | GOOGLE_API_KEY=no 84 | GOOGLE_DEFAULT_CLIENT_ID=no 85 | GOOGLE_DEFAULT_CLIENT_SECRET=no 86 | GTK_BASEPATH=C:\Program Files (x86)\GtkSharp\2.12\ 87 | HOMEDRIVE=C: 88 | HOMEPATH=\Users\lenovo 89 | INTEL_DEV_REDIST=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\ 90 | JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121 91 | KMP_DUPLICATE_LIB_OK=TRUE 92 | LOCALAPPDATA=C:\Users\lenovo\AppData\Local 93 | LOGONSERVER=\\DESKTOP-27NLM5S 94 | MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic 95 | MKL_SERIAL=YES 96 | NIDAQmxSwitchDir=C:\Program Files (x86)\National Instruments\NI-DAQ\Switch\ 97 | NIEXTCCOMPILERSUPP=C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\ 98 | NUMBER_OF_PROCESSORS=4 99 | OneDrive=C:\Users\lenovo\OneDrive 100 | OS=Windows_NT 101 | Path=C:\Python\Python37\Scripts\;C:\Python\Python37\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\MySQL\MySQL Utilities 1.6\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\MATLAB\R2007b\bin;C:\Program Files (x86)\MATLAB\R2007b\bin\win32;E:\MPLAB C32 Suite\bin;C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;"C:\Users\lenovo\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Java\jdk1.8.0_121\bin";C:\Users\lenovo\AppData\Local\Microsoft\WindowsApps;C:\Users\lenovo\AppData\Local\Programs\Microsoft VS Code\bin;C:\Python\Python37;C:\Users\lenovo\.dotnet\tools;C:\Users\lenovo\AppData\Roaming\npm;C:\Users\lenovo\AppData\Roaming\npm\node_modules\nodeman\bin; 102 | PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW 103 | POSTGIS_ENABLE_OUTDB_RASTERS=1 104 | POSTGIS_GDAL_ENABLED_DRIVERS=GTiff PNG JPEG GIF XYZ DTED USGSDEM AAIGrid 105 | PROCESSOR_ARCHITECTURE=AMD64 106 | PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 78 Stepping 3, GenuineIntel 107 | PROCESSOR_LEVEL=6 108 | PROCESSOR_REVISION=4e03 109 | ProgramData=C:\ProgramData 110 | ProgramFiles=C:\Program Files 111 | ProgramFiles(x86)=C:\Program Files (x86) 112 | ProgramW6432=C:\Program Files 113 | PROMPT=$P$G 114 | PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules\ 115 | PUBLIC=C:\Users\Public 116 | SESSIONNAME=Console 117 | SystemDrive=C: 118 | SystemRoot=C:\WINDOWS 119 | TEMP=C:\Users\lenovo\AppData\Local\Temp 120 | TMP=C:\Users\lenovo\AppData\Local\Temp 121 | USERDOMAIN=DESKTOP-27NLM5S 122 | USERDOMAIN_ROAMINGPROFILE=DESKTOP-27NLM5S 123 | USERNAME=lenovo 124 | USERPROFILE=C:\Users\lenovo 125 | VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\ 126 | windir=C:\WINDOWS 127 | 128 | I:\PROGRAM\Node.js\node-web-server>npm start 129 | 130 | > web-server@1.0.0 start I:\PROGRAM\Node.js\node-web-server 131 | > node server.js 132 | 133 | Server is Up on port 3000 134 | Terminate batch job (Y/N)? y -------------------------------------------------------------------------------- /node-todo-api/server/tests/server.test.js: -------------------------------------------------------------------------------- 1 | const expect = require('expect'); 2 | const request = require('supertest'); 3 | const {ObjectID} = require('mongodb'); 4 | 5 | const {app} = require('./../server'); 6 | const {Todo} = require('./../models/todo'); 7 | const {User} = require('./../models/user'); 8 | const {todos, populateTodos, users, populateUsers} = require('./seed/seed'); 9 | 10 | beforeEach(populateUsers); 11 | beforeEach(populateTodos); 12 | 13 | describe('POST /todos', () => { 14 | it('should create a new todo', (done) => { 15 | var text = 'Test todo text'; 16 | 17 | request(app) 18 | .post('/todos') 19 | .set('x-auth', users[0].tokens[0].token) 20 | .send({text}) 21 | .expect(200) 22 | .expect((res) => { 23 | expect(res.body.text).toBe(text); 24 | }) 25 | .end((err, res) => { 26 | if (err) { 27 | return done(err); 28 | } 29 | 30 | Todo.find({text}).then((todos) => { 31 | expect(todos.length).toBe(1); 32 | expect(todos[0].text).toBe(text); 33 | done(); 34 | }).catch((e) => done(e)); 35 | }); 36 | }); 37 | 38 | it('should not create todo with invalid body data', (done) => { 39 | request(app) 40 | .post('/todos') 41 | .set('x-auth', users[0].tokens[0].token) 42 | .send({}) 43 | .expect(400) 44 | .end((err, res) => { 45 | if (err) { 46 | return done(err); 47 | } 48 | 49 | Todo.find().then((todos) => { 50 | expect(todos.length).toBe(2); 51 | done(); 52 | }).catch((e) => done(e)); 53 | }); 54 | }); 55 | }); 56 | 57 | describe('GET /todos', () => { 58 | it('should get all todos', (done) => { 59 | request(app) 60 | .get('/todos') 61 | .set('x-auth', users[0].tokens[0].token) 62 | .expect(200) 63 | .expect((res) => { 64 | expect(res.body.todos.length).toBe(1); 65 | }) 66 | .end(done); 67 | }); 68 | }); 69 | 70 | describe('GET /todos/:id', () => { 71 | it('should return todo doc', (done) => { 72 | request(app) 73 | .get(`/todos/${todos[0]._id.toHexString()}`) 74 | .set('x-auth', users[0].tokens[0].token) 75 | .expect(200) 76 | .expect((res) => { 77 | expect(res.body.todo.text).toBe(todos[0].text); 78 | }) 79 | .end(done); 80 | }); 81 | 82 | it('should not return todo doc created by other user', (done) => { 83 | request(app) 84 | .get(`/todos/${todos[1]._id.toHexString()}`) 85 | .set('x-auth', users[0].tokens[0].token) 86 | .expect(404) 87 | .end(done); 88 | }); 89 | 90 | it('should return 404 if todo not found', (done) => { 91 | var hexId = new ObjectID().toHexString(); 92 | 93 | request(app) 94 | .get(`/todos/${hexId}`) 95 | .set('x-auth', users[0].tokens[0].token) 96 | .expect(404) 97 | .end(done); 98 | }); 99 | 100 | it('should return 404 for non-object ids', (done) => { 101 | request(app) 102 | .get('/todos/123abc') 103 | .set('x-auth', users[0].tokens[0].token) 104 | .expect(404) 105 | .end(done); 106 | }); 107 | }); 108 | 109 | describe('DELETE /todos/:id', () => { 110 | it('should remove a todo', (done) => { 111 | var hexId = todos[1]._id.toHexString(); 112 | 113 | request(app) 114 | .delete(`/todos/${hexId}`) 115 | .set('x-auth', users[1].tokens[0].token) 116 | .expect(200) 117 | .expect((res) => { 118 | expect(res.body.todo._id).toBe(hexId); 119 | }) 120 | .end((err, res) => { 121 | if (err) { 122 | return done(err); 123 | } 124 | 125 | Todo.findById(hexId).then((todo) => { 126 | expect(todo).toBeFalsy(); 127 | done(); 128 | }).catch((e) => done(e)); 129 | }); 130 | }); 131 | 132 | it('should remove a todo', (done) => { 133 | var hexId = todos[0]._id.toHexString(); 134 | 135 | request(app) 136 | .delete(`/todos/${hexId}`) 137 | .set('x-auth', users[1].tokens[0].token) 138 | .expect(404) 139 | .end((err, res) => { 140 | if (err) { 141 | return done(err); 142 | } 143 | 144 | Todo.findById(hexId).then((todo) => { 145 | expect(todo).toBeTruthy(); 146 | done(); 147 | }).catch((e) => done(e)); 148 | }); 149 | }); 150 | 151 | it('should return 404 if todo not found', (done) => { 152 | var hexId = new ObjectID().toHexString(); 153 | 154 | request(app) 155 | .delete(`/todos/${hexId}`) 156 | .set('x-auth', users[1].tokens[0].token) 157 | .expect(404) 158 | .end(done); 159 | }); 160 | 161 | it('should return 404 if object id is invalid', (done) => { 162 | request(app) 163 | .delete('/todos/123abc') 164 | .set('x-auth', users[1].tokens[0].token) 165 | .expect(404) 166 | .end(done); 167 | }); 168 | }); 169 | 170 | describe('PATCH /todos/:id', () => { 171 | it('should update the todo', (done) => { 172 | var hexId = todos[0]._id.toHexString(); 173 | var text = 'This should be the new text'; 174 | 175 | request(app) 176 | .patch(`/todos/${hexId}`) 177 | .set('x-auth', users[0].tokens[0].token) 178 | .send({ 179 | completed: true, 180 | text 181 | }) 182 | .expect(200) 183 | .expect((res) => { 184 | expect(res.body.todo.text).toBe(text); 185 | expect(res.body.todo.completed).toBe(true); 186 | expect(typeof res.body.todo.completedAt).toBe('number'); 187 | }) 188 | .end(done); 189 | }); 190 | 191 | it('should not update the todo created by other user', (done) => { 192 | var hexId = todos[0]._id.toHexString(); 193 | var text = 'This should be the new text'; 194 | 195 | request(app) 196 | .patch(`/todos/${hexId}`) 197 | .set('x-auth', users[1].tokens[0].token) 198 | .send({ 199 | completed: true, 200 | text 201 | }) 202 | .expect(404) 203 | .end(done); 204 | }); 205 | 206 | it('should clear completedAt when todo is not completed', (done) => { 207 | var hexId = todos[1]._id.toHexString(); 208 | var text = 'This should be the new text!!'; 209 | 210 | request(app) 211 | .patch(`/todos/${hexId}`) 212 | .set('x-auth', users[1].tokens[0].token) 213 | .send({ 214 | completed: false, 215 | text 216 | }) 217 | .expect(200) 218 | .expect((res) => { 219 | expect(res.body.todo.text).toBe(text); 220 | expect(res.body.todo.completed).toBe(false); 221 | expect(res.body.todo.completedAt).toBeFalsy(); 222 | }) 223 | .end(done); 224 | }); 225 | }); 226 | 227 | describe('GET /users/me', () => { 228 | it('should return user if authenticated', (done) => { 229 | request(app) 230 | .get('/users/me') 231 | .set('x-auth', users[0].tokens[0].token) 232 | .expect(200) 233 | .expect((res) => { 234 | expect(res.body._id).toBe(users[0]._id.toHexString()); 235 | expect(res.body.email).toBe(users[0].email); 236 | }) 237 | .end(done); 238 | }); 239 | 240 | it('should return 401 if not authenticated', (done) => { 241 | request(app) 242 | .get('/users/me') 243 | .expect(401) 244 | .expect((res) => { 245 | expect(res.body).toEqual({}); 246 | }) 247 | .end(done); 248 | }); 249 | }); 250 | 251 | 252 | describe('POST /users', () => { 253 | it('should create a user', (done) => { 254 | var email = 'example@example.com'; 255 | var password = '123mnb!'; 256 | 257 | request(app) 258 | .post('/users') 259 | .send({email, password}) 260 | .expect(200) 261 | .expect((res) => { 262 | expect(res.headers['x-auth']).toBeTruthy(); 263 | expect(res.body._id).toBeTruthy(); 264 | expect(res.body.email).toBe(email); 265 | }) 266 | .end((err) => { 267 | if (err) { 268 | return done(err); 269 | } 270 | 271 | User.findOne({email}).then((user) => { 272 | expect(user).toBeTruthy(); 273 | expect(user.password).not.toBe(password); 274 | done(); 275 | }).catch((e) => done(e)); 276 | }); 277 | }); 278 | 279 | it('should return validation errors if request invalid', (done) => { 280 | request(app) 281 | .post('/users') 282 | .send({ 283 | email: 'and', 284 | password: '123' 285 | }) 286 | .expect(400) 287 | .end(done); 288 | }); 289 | 290 | it('should not create user if email in use', (done) => { 291 | request(app) 292 | .post('/users') 293 | .send({ 294 | email: users[0].email, 295 | password: 'Password123!' 296 | }) 297 | .expect(400) 298 | .end(done); 299 | }); 300 | }); 301 | 302 | 303 | describe('POST /users/login', () => { 304 | it('should login user and return auth token', (done) => { 305 | request(app) 306 | .post('/users/login') 307 | .send({ 308 | email: users[1].email, 309 | password: users[1].password 310 | }) 311 | .expect(200) 312 | .expect((res) => { 313 | expect(res.headers['x-auth']).toBeTruthy(); 314 | }) 315 | .end((err, res) => { 316 | if (err) { 317 | return done(err); 318 | } 319 | 320 | User.findById(users[1]._id).then((user) => { 321 | expect(user.toObject().tokens[1]).toMatchObject({ 322 | access: 'auth', 323 | token: res.headers['x-auth'] 324 | }); 325 | done(); 326 | }).catch((e) => done(e)); 327 | }); 328 | }); 329 | 330 | it('should reject invalid login', (done) => { 331 | request(app) 332 | .post('/users/login') 333 | .send({ 334 | email: users[1].email, 335 | password: users[1].password + '1' 336 | }) 337 | .expect(400) 338 | .expect((res) => { 339 | expect(res.headers['x-auth']).toBeFalsy(); 340 | }) 341 | .end((err, res) => { 342 | if (err) { 343 | return done(err); 344 | } 345 | 346 | User.findById(users[1]._id).then((user) => { 347 | expect(user.tokens.length).toBe(1); 348 | done(); 349 | }).catch((e) => done(e)); 350 | }); 351 | }); 352 | }); 353 | 354 | describe('DELETE /users/me/token', () => { 355 | it('should remove auth token on logout', (done) => { 356 | request(app) 357 | .delete('/users/me/token') 358 | .set('x-auth', users[0].tokens[0].token) 359 | .expect(200) 360 | .end((err, res) => { 361 | if (err) { 362 | return done(err); 363 | } 364 | 365 | User.findById(users[0]._id).then((user) => { 366 | expect(user.tokens.length).toBe(0); 367 | done(); 368 | }).catch((e) => done(e)); 369 | }); 370 | }); 371 | }); 372 | -------------------------------------------------------------------------------- /hostel Management/views/dashboard.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | DashBoard 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
    24 | 27 | 28 |
    29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
    41 | 44 |
    45 | 46 |
    47 | 48 | 51 | 52 | 125 | 126 | 129 | 130 |
    131 |
    132 |
    133 |
    134 |
    135 |
    136 |

    DashBoard

    137 |
    138 |
    139 |
    140 | 141 |
    142 |
    143 |
    144 |
    145 |
    146 |
    147 |
    148 |
    149 |
    150 |


    Step 1 : Register For Hostel

    151 |
    152 | 153 |
    154 |
    155 | 156 |

    You haven't registered


    157 | Apply 158 |
    159 |
    160 |
    161 | 162 |
    163 |
    164 | 165 |
    166 |
    167 |
    168 |


    Step 2 :Status Of Application

    169 |
    170 | 171 |
    172 | 173 |
    174 |

    Your Application is in process...


    175 |
    176 |
    177 |
    178 | 179 |
    180 |
    181 | 182 |
    183 |
    184 |
    185 |


    Step 3 : Choose Your Roommates...

    186 |
    187 | 188 |
    189 |
    190 |

    You haven't kept your choice yet


    191 | Choose 192 |
    193 |
    194 |
    195 | 196 |
    197 |
    198 | 199 |
    200 |
    201 |
    202 |


    Step 4 : final Allotment


    203 |
    204 | 205 |
    206 |
    207 | 208 |

    final List Not Ready yet ...


    Wait for a day

    209 | Check 210 |
    211 |
    212 |
    213 | 214 |
    215 | 216 |
    217 | 218 |
    219 | 220 |
    221 | 222 |
    223 | 224 |
    225 | 226 |
    227 | 228 |
    229 | 230 | 231 | 232 |
    233 |
    234 |

    © Copyrights MindInvaders. No Rights Reserved

    235 |
    236 | Created by PICT Student for hackhathon 237 |
    238 | 239 |
    240 |
    241 | 242 |
    243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | -------------------------------------------------------------------------------- /GitBASH Text when run first time .txt: -------------------------------------------------------------------------------- 1 | 2 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 3 | $ git --version 4 | git version 2.19.0.windows.1 5 | 6 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 7 | $ git init 8 | Reinitialized existing Git repository in I:/PROGRAM/Node.js/node-web-server/.git / 9 | 10 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 11 | $ ls -a 12 | ./ .git/ package.json public/ server.log 13 | ../ node_modules/ package-lock.json server.js views/ 14 | 15 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 16 | $ git status 17 | On branch master 18 | 19 | No commits yet 20 | 21 | Untracked files: 22 | (use "git add ..." to include in what will be committed) 23 | 24 | node_modules/ 25 | package-lock.json 26 | package.json 27 | public/ 28 | server.js 29 | server.log 30 | views/ 31 | 32 | nothing added to commit but untracked files present (use "git add" to track) 33 | 34 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 35 | $ git add package.json 36 | warning: LF will be replaced by CRLF in package.json. 37 | The file will have its original line endings in your working directory 38 | 39 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 40 | $ git status 41 | On branch master 42 | 43 | No commits yet 44 | 45 | Changes to be committed: 46 | (use "git rm --cached ..." to unstage) 47 | 48 | new file: package.json 49 | 50 | Untracked files: 51 | (use "git add ..." to include in what will be committed) 52 | 53 | node_modules/ 54 | package-lock.json 55 | public/ 56 | server.js 57 | server.log 58 | views/ 59 | 60 | 61 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 62 | $ git add public/ 63 | 64 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 65 | $ git add server.js 66 | 67 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 68 | $ git status 69 | On branch master 70 | 71 | No commits yet 72 | 73 | Changes to be committed: 74 | (use "git rm --cached ..." to unstage) 75 | 76 | new file: package.json 77 | new file: public/help.html 78 | new file: server.js 79 | 80 | Untracked files: 81 | (use "git add ..." to include in what will be committed) 82 | 83 | node_modules/ 84 | package-lock.json 85 | server.log 86 | views/ 87 | 88 | 89 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 90 | $ git add views/ 91 | 92 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 93 | $ git status 94 | On branch master 95 | 96 | No commits yet 97 | 98 | Changes to be committed: 99 | (use "git rm --cached ..." to unstage) 100 | 101 | new file: package.json 102 | new file: public/help.html 103 | new file: server.js 104 | new file: views/about.hbs 105 | new file: views/home.hbs 106 | new file: views/maintenance.hbs 107 | new file: views/partials/footer.hbs 108 | new file: views/partials/header.hbs 109 | 110 | Untracked files: 111 | (use "git add ..." to include in what will be committed) 112 | 113 | node_modules/ 114 | package-lock.json 115 | server.log 116 | 117 | 118 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 119 | $ git status 120 | On branch master 121 | 122 | No commits yet 123 | 124 | Changes to be committed: 125 | (use "git rm --cached ..." to unstage) 126 | 127 | new file: package.json 128 | new file: public/help.html 129 | new file: server.js 130 | new file: views/about.hbs 131 | new file: views/home.hbs 132 | new file: views/maintenance.hbs 133 | new file: views/partials/footer.hbs 134 | new file: views/partials/header.hbs 135 | 136 | Untracked files: 137 | (use "git add ..." to include in what will be committed) 138 | 139 | .gitignore 140 | 141 | 142 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 143 | $ giit add .gitignore 144 | bash: giit: command not found 145 | 146 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 147 | $ git status 148 | On branch master 149 | 150 | No commits yet 151 | 152 | Changes to be committed: 153 | (use "git rm --cached ..." to unstage) 154 | 155 | new file: package.json 156 | new file: public/help.html 157 | new file: server.js 158 | new file: views/about.hbs 159 | new file: views/home.hbs 160 | new file: views/maintenance.hbs 161 | new file: views/partials/footer.hbs 162 | new file: views/partials/header.hbs 163 | 164 | Untracked files: 165 | (use "git add ..." to include in what will be committed) 166 | 167 | .gitignore 168 | 169 | 170 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 171 | $ git add .gitignore 172 | 173 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 174 | $ git status 175 | On branch master 176 | 177 | No commits yet 178 | 179 | Changes to be committed: 180 | (use "git rm --cached ..." to unstage) 181 | 182 | new file: .gitignore 183 | new file: package.json 184 | new file: public/help.html 185 | new file: server.js 186 | new file: views/about.hbs 187 | new file: views/home.hbs 188 | new file: views/maintenance.hbs 189 | new file: views/partials/footer.hbs 190 | new file: views/partials/header.hbs 191 | 192 | 193 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 194 | $ git commit -m 'Inital commit' 195 | 196 | *** Please tell me who you are. 197 | 198 | Run 199 | 200 | git config --global user.email "you@example.com" 201 | git config --global user.name "Your Name" 202 | 203 | to set your account's default identity. 204 | Omit --global to set the identity only in this repository. 205 | 206 | fatal: unable to auto-detect email address (got 'lenovo@DESKTOP-27NLM5S.(none)') 207 | 208 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 209 | $ git status 210 | On branch master 211 | 212 | No commits yet 213 | 214 | Changes to be committed: 215 | (use "git rm --cached ..." to unstage) 216 | 217 | new file: .gitignore 218 | new file: package.json 219 | new file: public/help.html 220 | new file: server.js 221 | new file: views/about.hbs 222 | new file: views/home.hbs 223 | new file: views/maintenance.hbs 224 | new file: views/partials/footer.hbs 225 | new file: views/partials/header.hbs 226 | 227 | 228 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 229 | $ git commit -m 'Inital Commit' 230 | 231 | *** Please tell me who you are. 232 | 233 | Run 234 | 235 | git config --global user.email "you@example.com" 236 | git config --global user.name "Your Name" 237 | 238 | to set your account's default identity. 239 | Omit --global to set the identity only in this repository. 240 | 241 | fatal: unable to auto-detect email address (got 'lenovo@DESKTOP-27NLM5S.(none)') 242 | 243 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 244 | $ git config user.email "ashleshuk@gmail.com" 245 | 246 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 247 | $ git config user.name "Ashlesh" 248 | 249 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 250 | $ git commit -m 'Inital Commit' 251 | [master (root-commit) 22e4a48] Inital Commit 252 | 9 files changed, 179 insertions(+) 253 | create mode 100644 .gitignore 254 | create mode 100644 package.json 255 | create mode 100644 public/help.html 256 | create mode 100644 server.js 257 | create mode 100644 views/about.hbs 258 | create mode 100644 views/home.hbs 259 | create mode 100644 views/maintenance.hbs 260 | create mode 100644 views/partials/footer.hbs 261 | create mode 100644 views/partials/header.hbs 262 | 263 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 264 | $ git status 265 | On branch master 266 | nothing to commit, working tree clean 267 | 268 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 269 | $ ls -al ~/.ssh 270 | ls: cannot access '/c/Users/lenovo/.ssh': No such file or directory 271 | 272 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 273 | $ ssh-keygen -t rsa -b 4096 -C 'ashleshuk@gmail.com' 274 | Generating public/private rsa key pair. 275 | Enter file in which to save the key (/c/Users/lenovo/.ssh/id_rsa): 276 | Created directory '/c/Users/lenovo/.ssh'. 277 | Enter passphrase (empty for no passphrase): 278 | Enter same passphrase again: 279 | Your identification has been saved in /c/Users/lenovo/.ssh/id_rsa. 280 | Your public key has been saved in /c/Users/lenovo/.ssh/id_rsa.pub. 281 | The key fingerprint is: 282 | SHA256:tW9tK+PxlJDG1yY6CaKPRzsbNJwWNOuTLVsXUpwGjM4 ashleshuk@gmail.com 283 | The key's randomart image is: 284 | +---[RSA 4096]----+ 285 | | oo.o.. | 286 | | ..o..+ | 287 | | oo o.. | 288 | | oE* + o . | 289 | | S = * o o| 290 | | +.B = * + | 291 | | ..o. B = | 292 | | o+. .o* . | 293 | | ..oo ..oo | 294 | +----[SHA256]-----+ 295 | 296 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 297 | $ ls -al ~/.ssh 298 | total 28 299 | drwxr-xr-x 1 lenovo 197121 0 Sep 24 07:02 ./ 300 | drwxr-xr-x 1 lenovo 197121 0 Sep 24 07:02 ../ 301 | -rw-r--r-- 1 lenovo 197121 3243 Sep 24 07:02 id_rsa 302 | -rw-r--r-- 1 lenovo 197121 745 Sep 24 07:02 id_rsa.pub 303 | 304 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 305 | $ eval "$(ssh-agent -s)" 306 | Agent pid 16224 307 | 308 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 309 | $ ssh-add ~/.ssh/id_rsa 310 | Error connecting to agent: Connection timed out 311 | 312 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 313 | $ ssh-add ~/.ssh/id_rsa 314 | Error connecting to agent: Connection timed out 315 | 316 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 317 | $ ssh-add ~/.ssh/id_rsa 318 | Error connecting to agent: Connection timed out 319 | 320 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 321 | $ ssh-add ~/.ssh/id_rsa 322 | Identity added: /c/Users/lenovo/.ssh/id_rsa (/c/Users/lenovo/.ssh/id_rsa) 323 | 324 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 325 | $ clip < ~/.ssh/id_rsa.pub 326 | 327 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 328 | $ ssh -T git@github.com 329 | The authenticity of host 'github.com (192.30.253.112)' can't be established. 330 | RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. 331 | Are you sure you want to continue connecting (yes/no)? y 332 | Please type 'yes' or 'no': yes 333 | Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts. 334 | Hi Ashleshk! You've successfully authenticated, but GitHub does not provide shell access. 335 | 336 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 337 | $ git remote add origin https://github.com/Ashleshk/node-course-2-web-server.git 338 | 339 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 340 | $ git push -u origin master 341 | Enumerating objects: 14, done. 342 | Counting objects: 100% (14/14), done. 343 | Delta compression using up to 4 threads 344 | Compressing objects: 100% (12/12), done. 345 | Writing objects: 100% (14/14), 2.38 KiB | 610.00 KiB/s, done. 346 | Total 14 (delta 3), reused 0 (delta 0) 347 | remote: Resolving deltas: 100% (3/3), done. 348 | remote: 349 | remote: Create a pull request for 'master' on GitHub by visiting: 350 | remote: https://github.com/Ashleshk/node-course-2-web-server/pull/new/master 351 | remote: 352 | To https://github.com/Ashleshk/node-course-2-web-server.git 353 | * [new branch] master -> master 354 | Branch 'master' set up to track remote branch 'master' from 'origin'. 355 | 356 | lenovo@DESKTOP-27NLM5S MINGW64 /i/PROGRAM/Node.js/node-web-server (master) 357 | $ 358 | -------------------------------------------------------------------------------- /hostel Management/server.log: -------------------------------------------------------------------------------- 1 | Tue Sep 25 2018 13:31:42 GMT+0530 (India Standard Time): + GET / 2 | Tue Sep 25 2018 13:31:45 GMT+0530 (India Standard Time): + GET /favicon.ico 3 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /about 4 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 5 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 6 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /css/style-responsive.css 7 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /css/style.css 8 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /avatar.png 9 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 10 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 11 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/jquery.nicescroll.js 12 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/common-scripts.js 13 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 14 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 15 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/jquery.nicescroll.js 16 | Tue Sep 25 2018 13:32:00 GMT+0530 (India Standard Time): + GET /lib/common-scripts.js 17 | Tue Sep 25 2018 13:35:05 GMT+0530 (India Standard Time): + GET / 18 | Tue Sep 25 2018 13:35:10 GMT+0530 (India Standard Time): + GET / 19 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET / 20 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 21 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 22 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 23 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET /css/style.css 24 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 25 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 26 | Tue Sep 25 2018 13:35:56 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 27 | Tue Sep 25 2018 13:50:46 GMT+0530 (India Standard Time): + GET / 28 | Tue Sep 25 2018 13:50:46 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 29 | Tue Sep 25 2018 13:50:46 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 30 | Tue Sep 25 2018 13:50:46 GMT+0530 (India Standard Time): + GET /css/style.css 31 | Tue Sep 25 2018 13:50:46 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 32 | Tue Sep 25 2018 13:50:46 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 33 | Tue Sep 25 2018 13:50:47 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 34 | Tue Sep 25 2018 13:50:47 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 35 | Tue Sep 25 2018 13:50:50 GMT+0530 (India Standard Time): + GET / 36 | Tue Sep 25 2018 13:50:51 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 37 | Tue Sep 25 2018 13:50:51 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 38 | Tue Sep 25 2018 13:50:51 GMT+0530 (India Standard Time): + GET /css/style.css 39 | Tue Sep 25 2018 13:50:51 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 40 | Tue Sep 25 2018 13:50:51 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 41 | Tue Sep 25 2018 13:50:51 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 42 | Tue Sep 25 2018 13:50:51 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 43 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET / 44 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 45 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 46 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET /css/style.css 47 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 48 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 49 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 50 | Tue Sep 25 2018 13:50:55 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 51 | Tue Sep 25 2018 13:55:55 GMT+0530 (India Standard Time): + GET / 52 | Tue Sep 25 2018 13:55:56 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 53 | Tue Sep 25 2018 13:55:56 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 54 | Tue Sep 25 2018 13:55:56 GMT+0530 (India Standard Time): + GET /css/style.css 55 | Tue Sep 25 2018 13:55:56 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 56 | Tue Sep 25 2018 13:55:56 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 57 | Tue Sep 25 2018 13:55:56 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 58 | Tue Sep 25 2018 13:55:57 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 59 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET / 60 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 61 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 62 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET /css/style.css 63 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 64 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 65 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 66 | Tue Sep 25 2018 13:55:59 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 67 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET / 68 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 69 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 70 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET /css/style.css 71 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 72 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 73 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 74 | Tue Sep 25 2018 13:56:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 75 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET / 76 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 77 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 78 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /css/style.css 79 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 80 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 81 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 82 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 83 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET / 84 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 85 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 86 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /css/style.css 87 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 88 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 89 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 90 | Tue Sep 25 2018 13:56:01 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 91 | Tue Sep 25 2018 14:02:18 GMT+0530 (India Standard Time): + GET / 92 | Tue Sep 25 2018 14:02:19 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 93 | Tue Sep 25 2018 14:02:19 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 94 | Tue Sep 25 2018 14:02:20 GMT+0530 (India Standard Time): + GET /css/style.css 95 | Tue Sep 25 2018 14:02:20 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 96 | Tue Sep 25 2018 14:02:20 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 97 | Tue Sep 25 2018 14:02:21 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 98 | Tue Sep 25 2018 14:02:21 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 99 | Tue Sep 25 2018 14:03:56 GMT+0530 (India Standard Time): + GET / 100 | Tue Sep 25 2018 14:03:56 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 101 | Tue Sep 25 2018 14:03:56 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 102 | Tue Sep 25 2018 14:03:56 GMT+0530 (India Standard Time): + GET /css/style.css 103 | Tue Sep 25 2018 14:03:56 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 104 | Tue Sep 25 2018 14:03:56 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 105 | Tue Sep 25 2018 14:03:57 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 106 | Tue Sep 25 2018 14:03:57 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 107 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET / 108 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 109 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 110 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET /css/style.css 111 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 112 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 113 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 114 | Tue Sep 25 2018 14:04:00 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 115 | Tue Sep 25 2018 14:04:06 GMT+0530 (India Standard Time): + GET / 116 | Tue Sep 25 2018 14:04:06 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 117 | Tue Sep 25 2018 14:04:06 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 118 | Tue Sep 25 2018 14:04:06 GMT+0530 (India Standard Time): + GET /css/style.css 119 | Tue Sep 25 2018 14:04:06 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 120 | Tue Sep 25 2018 14:04:06 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 121 | Tue Sep 25 2018 14:04:07 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 122 | Tue Sep 25 2018 14:04:07 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 123 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET / 124 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 125 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 126 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET /css/style.css 127 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 128 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 129 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 130 | Tue Sep 25 2018 14:04:10 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 131 | Tue Sep 25 2018 14:05:49 GMT+0530 (India Standard Time): + GET /about 132 | Tue Sep 25 2018 14:05:49 GMT+0530 (India Standard Time): + GET /lib/bootstrap/css/bootstrap.min.css 133 | Tue Sep 25 2018 14:05:49 GMT+0530 (India Standard Time): + GET /lib/font-awesome/css/font-awesome.css 134 | Tue Sep 25 2018 14:05:49 GMT+0530 (India Standard Time): + GET /css/style-responsive.css 135 | Tue Sep 25 2018 14:05:49 GMT+0530 (India Standard Time): + GET /css/style.css 136 | Tue Sep 25 2018 14:05:49 GMT+0530 (India Standard Time): + GET /avatar.png 137 | Tue Sep 25 2018 14:05:49 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 138 | Tue Sep 25 2018 14:05:50 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 139 | Tue Sep 25 2018 14:05:50 GMT+0530 (India Standard Time): + GET /lib/jquery.nicescroll.js 140 | Tue Sep 25 2018 14:05:50 GMT+0530 (India Standard Time): + GET /lib/common-scripts.js 141 | Tue Sep 25 2018 14:05:50 GMT+0530 (India Standard Time): + GET /lib/jquery/jquery.min.js 142 | Tue Sep 25 2018 14:05:50 GMT+0530 (India Standard Time): + GET /lib/bootstrap/js/bootstrap.min.js 143 | Tue Sep 25 2018 14:05:50 GMT+0530 (India Standard Time): + GET /lib/jquery.nicescroll.js 144 | Tue Sep 25 2018 14:05:50 GMT+0530 (India Standard Time): + GET /lib/common-scripts.js 145 | -------------------------------------------------------------------------------- /weather/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "ajv": { 6 | "version": "5.5.2", 7 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", 8 | "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", 9 | "requires": { 10 | "co": "^4.6.0", 11 | "fast-deep-equal": "^1.0.0", 12 | "fast-json-stable-stringify": "^2.0.0", 13 | "json-schema-traverse": "^0.3.0" 14 | } 15 | }, 16 | "asn1": { 17 | "version": "0.2.4", 18 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 19 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 20 | "requires": { 21 | "safer-buffer": "~2.1.0" 22 | } 23 | }, 24 | "assert-plus": { 25 | "version": "1.0.0", 26 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 27 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 28 | }, 29 | "asynckit": { 30 | "version": "0.4.0", 31 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 32 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 33 | }, 34 | "aws-sign2": { 35 | "version": "0.7.0", 36 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 37 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 38 | }, 39 | "aws4": { 40 | "version": "1.8.0", 41 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", 42 | "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" 43 | }, 44 | "bcrypt-pbkdf": { 45 | "version": "1.0.2", 46 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 47 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 48 | "optional": true, 49 | "requires": { 50 | "tweetnacl": "^0.14.3" 51 | } 52 | }, 53 | "caseless": { 54 | "version": "0.12.0", 55 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 56 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 57 | }, 58 | "co": { 59 | "version": "4.6.0", 60 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 61 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" 62 | }, 63 | "combined-stream": { 64 | "version": "1.0.7", 65 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", 66 | "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", 67 | "requires": { 68 | "delayed-stream": "~1.0.0" 69 | } 70 | }, 71 | "core-util-is": { 72 | "version": "1.0.2", 73 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 74 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 75 | }, 76 | "dashdash": { 77 | "version": "1.14.1", 78 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 79 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 80 | "requires": { 81 | "assert-plus": "^1.0.0" 82 | } 83 | }, 84 | "delayed-stream": { 85 | "version": "1.0.0", 86 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 87 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 88 | }, 89 | "ecc-jsbn": { 90 | "version": "0.1.2", 91 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 92 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 93 | "optional": true, 94 | "requires": { 95 | "jsbn": "~0.1.0", 96 | "safer-buffer": "^2.1.0" 97 | } 98 | }, 99 | "extend": { 100 | "version": "3.0.2", 101 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 102 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 103 | }, 104 | "extsprintf": { 105 | "version": "1.3.0", 106 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 107 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 108 | }, 109 | "fast-deep-equal": { 110 | "version": "1.1.0", 111 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", 112 | "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" 113 | }, 114 | "fast-json-stable-stringify": { 115 | "version": "2.0.0", 116 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 117 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 118 | }, 119 | "forever-agent": { 120 | "version": "0.6.1", 121 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 122 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 123 | }, 124 | "form-data": { 125 | "version": "2.3.2", 126 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", 127 | "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", 128 | "requires": { 129 | "asynckit": "^0.4.0", 130 | "combined-stream": "1.0.6", 131 | "mime-types": "^2.1.12" 132 | }, 133 | "dependencies": { 134 | "combined-stream": { 135 | "version": "1.0.6", 136 | "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", 137 | "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", 138 | "requires": { 139 | "delayed-stream": "~1.0.0" 140 | } 141 | } 142 | } 143 | }, 144 | "getpass": { 145 | "version": "0.1.7", 146 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 147 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 148 | "requires": { 149 | "assert-plus": "^1.0.0" 150 | } 151 | }, 152 | "har-schema": { 153 | "version": "2.0.0", 154 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 155 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 156 | }, 157 | "har-validator": { 158 | "version": "5.1.0", 159 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", 160 | "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", 161 | "requires": { 162 | "ajv": "^5.3.0", 163 | "har-schema": "^2.0.0" 164 | } 165 | }, 166 | "http-signature": { 167 | "version": "1.2.0", 168 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 169 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 170 | "requires": { 171 | "assert-plus": "^1.0.0", 172 | "jsprim": "^1.2.2", 173 | "sshpk": "^1.7.0" 174 | } 175 | }, 176 | "is-typedarray": { 177 | "version": "1.0.0", 178 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 179 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 180 | }, 181 | "isstream": { 182 | "version": "0.1.2", 183 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 184 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 185 | }, 186 | "jsbn": { 187 | "version": "0.1.1", 188 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 189 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 190 | "optional": true 191 | }, 192 | "json-schema": { 193 | "version": "0.2.3", 194 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 195 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 196 | }, 197 | "json-schema-traverse": { 198 | "version": "0.3.1", 199 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", 200 | "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" 201 | }, 202 | "json-stringify-safe": { 203 | "version": "5.0.1", 204 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 205 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 206 | }, 207 | "jsprim": { 208 | "version": "1.4.1", 209 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 210 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 211 | "requires": { 212 | "assert-plus": "1.0.0", 213 | "extsprintf": "1.3.0", 214 | "json-schema": "0.2.3", 215 | "verror": "1.10.0" 216 | } 217 | }, 218 | "mime-db": { 219 | "version": "1.36.0", 220 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", 221 | "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==" 222 | }, 223 | "mime-types": { 224 | "version": "2.1.20", 225 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", 226 | "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", 227 | "requires": { 228 | "mime-db": "~1.36.0" 229 | } 230 | }, 231 | "oauth-sign": { 232 | "version": "0.9.0", 233 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 234 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 235 | }, 236 | "performance-now": { 237 | "version": "2.1.0", 238 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 239 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 240 | }, 241 | "psl": { 242 | "version": "1.1.29", 243 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", 244 | "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" 245 | }, 246 | "punycode": { 247 | "version": "1.4.1", 248 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 249 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 250 | }, 251 | "qs": { 252 | "version": "6.5.2", 253 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 254 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 255 | }, 256 | "request": { 257 | "version": "2.88.0", 258 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", 259 | "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", 260 | "requires": { 261 | "aws-sign2": "~0.7.0", 262 | "aws4": "^1.8.0", 263 | "caseless": "~0.12.0", 264 | "combined-stream": "~1.0.6", 265 | "extend": "~3.0.2", 266 | "forever-agent": "~0.6.1", 267 | "form-data": "~2.3.2", 268 | "har-validator": "~5.1.0", 269 | "http-signature": "~1.2.0", 270 | "is-typedarray": "~1.0.0", 271 | "isstream": "~0.1.2", 272 | "json-stringify-safe": "~5.0.1", 273 | "mime-types": "~2.1.19", 274 | "oauth-sign": "~0.9.0", 275 | "performance-now": "^2.1.0", 276 | "qs": "~6.5.2", 277 | "safe-buffer": "^5.1.2", 278 | "tough-cookie": "~2.4.3", 279 | "tunnel-agent": "^0.6.0", 280 | "uuid": "^3.3.2" 281 | } 282 | }, 283 | "safe-buffer": { 284 | "version": "5.1.2", 285 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 286 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 287 | }, 288 | "safer-buffer": { 289 | "version": "2.1.2", 290 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 291 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 292 | }, 293 | "sshpk": { 294 | "version": "1.14.2", 295 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", 296 | "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", 297 | "requires": { 298 | "asn1": "~0.2.3", 299 | "assert-plus": "^1.0.0", 300 | "bcrypt-pbkdf": "^1.0.0", 301 | "dashdash": "^1.12.0", 302 | "ecc-jsbn": "~0.1.1", 303 | "getpass": "^0.1.1", 304 | "jsbn": "~0.1.0", 305 | "safer-buffer": "^2.0.2", 306 | "tweetnacl": "~0.14.0" 307 | } 308 | }, 309 | "tough-cookie": { 310 | "version": "2.4.3", 311 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", 312 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", 313 | "requires": { 314 | "psl": "^1.1.24", 315 | "punycode": "^1.4.1" 316 | } 317 | }, 318 | "tunnel-agent": { 319 | "version": "0.6.0", 320 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 321 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 322 | "requires": { 323 | "safe-buffer": "^5.0.1" 324 | } 325 | }, 326 | "tweetnacl": { 327 | "version": "0.14.5", 328 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 329 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 330 | "optional": true 331 | }, 332 | "uuid": { 333 | "version": "3.3.2", 334 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 335 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 336 | }, 337 | "verror": { 338 | "version": "1.10.0", 339 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 340 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 341 | "requires": { 342 | "assert-plus": "^1.0.0", 343 | "core-util-is": "1.0.2", 344 | "extsprintf": "^1.2.0" 345 | } 346 | } 347 | } 348 | } 349 | -------------------------------------------------------------------------------- /push notification/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "push-notification", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ajv": { 8 | "version": "6.5.5", 9 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", 10 | "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", 11 | "requires": { 12 | "fast-deep-equal": "^2.0.1", 13 | "fast-json-stable-stringify": "^2.0.0", 14 | "json-schema-traverse": "^0.4.1", 15 | "uri-js": "^4.2.2" 16 | } 17 | }, 18 | "asn1": { 19 | "version": "0.2.4", 20 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 21 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 22 | "requires": { 23 | "safer-buffer": "~2.1.0" 24 | } 25 | }, 26 | "assert-plus": { 27 | "version": "1.0.0", 28 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 29 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 30 | }, 31 | "asynckit": { 32 | "version": "0.4.0", 33 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 34 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 35 | }, 36 | "aws-sign2": { 37 | "version": "0.7.0", 38 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 39 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 40 | }, 41 | "aws4": { 42 | "version": "1.8.0", 43 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", 44 | "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" 45 | }, 46 | "bcrypt-pbkdf": { 47 | "version": "1.0.2", 48 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 49 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 50 | "requires": { 51 | "tweetnacl": "^0.14.3" 52 | } 53 | }, 54 | "caseless": { 55 | "version": "0.12.0", 56 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 57 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 58 | }, 59 | "combined-stream": { 60 | "version": "1.0.7", 61 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", 62 | "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", 63 | "requires": { 64 | "delayed-stream": "~1.0.0" 65 | } 66 | }, 67 | "core-util-is": { 68 | "version": "1.0.2", 69 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 70 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 71 | }, 72 | "dashdash": { 73 | "version": "1.14.1", 74 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 75 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 76 | "requires": { 77 | "assert-plus": "^1.0.0" 78 | } 79 | }, 80 | "delayed-stream": { 81 | "version": "1.0.0", 82 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 83 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 84 | }, 85 | "ecc-jsbn": { 86 | "version": "0.1.2", 87 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 88 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 89 | "requires": { 90 | "jsbn": "~0.1.0", 91 | "safer-buffer": "^2.1.0" 92 | } 93 | }, 94 | "extend": { 95 | "version": "3.0.2", 96 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 97 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 98 | }, 99 | "extsprintf": { 100 | "version": "1.3.0", 101 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 102 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 103 | }, 104 | "fast-deep-equal": { 105 | "version": "2.0.1", 106 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 107 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" 108 | }, 109 | "fast-json-stable-stringify": { 110 | "version": "2.0.0", 111 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 112 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 113 | }, 114 | "forever-agent": { 115 | "version": "0.6.1", 116 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 117 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 118 | }, 119 | "form-data": { 120 | "version": "2.3.3", 121 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", 122 | "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", 123 | "requires": { 124 | "asynckit": "^0.4.0", 125 | "combined-stream": "^1.0.6", 126 | "mime-types": "^2.1.12" 127 | } 128 | }, 129 | "getpass": { 130 | "version": "0.1.7", 131 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 132 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 133 | "requires": { 134 | "assert-plus": "^1.0.0" 135 | } 136 | }, 137 | "har-schema": { 138 | "version": "2.0.0", 139 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 140 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 141 | }, 142 | "har-validator": { 143 | "version": "5.1.3", 144 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", 145 | "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", 146 | "requires": { 147 | "ajv": "^6.5.5", 148 | "har-schema": "^2.0.0" 149 | } 150 | }, 151 | "http-signature": { 152 | "version": "1.2.0", 153 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 154 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 155 | "requires": { 156 | "assert-plus": "^1.0.0", 157 | "jsprim": "^1.2.2", 158 | "sshpk": "^1.7.0" 159 | } 160 | }, 161 | "is-typedarray": { 162 | "version": "1.0.0", 163 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 164 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 165 | }, 166 | "isstream": { 167 | "version": "0.1.2", 168 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 169 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 170 | }, 171 | "jsbn": { 172 | "version": "0.1.1", 173 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 174 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 175 | }, 176 | "json-schema": { 177 | "version": "0.2.3", 178 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 179 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 180 | }, 181 | "json-schema-traverse": { 182 | "version": "0.4.1", 183 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 184 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 185 | }, 186 | "json-stringify-safe": { 187 | "version": "5.0.1", 188 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 189 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 190 | }, 191 | "jsprim": { 192 | "version": "1.4.1", 193 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 194 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 195 | "requires": { 196 | "assert-plus": "1.0.0", 197 | "extsprintf": "1.3.0", 198 | "json-schema": "0.2.3", 199 | "verror": "1.10.0" 200 | } 201 | }, 202 | "mime-db": { 203 | "version": "1.37.0", 204 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", 205 | "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" 206 | }, 207 | "mime-types": { 208 | "version": "2.1.21", 209 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", 210 | "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", 211 | "requires": { 212 | "mime-db": "~1.37.0" 213 | } 214 | }, 215 | "oauth-sign": { 216 | "version": "0.9.0", 217 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 218 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 219 | }, 220 | "performance-now": { 221 | "version": "2.1.0", 222 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 223 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 224 | }, 225 | "psl": { 226 | "version": "1.1.29", 227 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", 228 | "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" 229 | }, 230 | "punycode": { 231 | "version": "2.1.1", 232 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 233 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 234 | }, 235 | "qs": { 236 | "version": "6.5.2", 237 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 238 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 239 | }, 240 | "request": { 241 | "version": "2.88.0", 242 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", 243 | "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", 244 | "requires": { 245 | "aws-sign2": "~0.7.0", 246 | "aws4": "^1.8.0", 247 | "caseless": "~0.12.0", 248 | "combined-stream": "~1.0.6", 249 | "extend": "~3.0.2", 250 | "forever-agent": "~0.6.1", 251 | "form-data": "~2.3.2", 252 | "har-validator": "~5.1.0", 253 | "http-signature": "~1.2.0", 254 | "is-typedarray": "~1.0.0", 255 | "isstream": "~0.1.2", 256 | "json-stringify-safe": "~5.0.1", 257 | "mime-types": "~2.1.19", 258 | "oauth-sign": "~0.9.0", 259 | "performance-now": "^2.1.0", 260 | "qs": "~6.5.2", 261 | "safe-buffer": "^5.1.2", 262 | "tough-cookie": "~2.4.3", 263 | "tunnel-agent": "^0.6.0", 264 | "uuid": "^3.3.2" 265 | } 266 | }, 267 | "safe-buffer": { 268 | "version": "5.1.2", 269 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 270 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 271 | }, 272 | "safer-buffer": { 273 | "version": "2.1.2", 274 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 275 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 276 | }, 277 | "sshpk": { 278 | "version": "1.15.2", 279 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", 280 | "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", 281 | "requires": { 282 | "asn1": "~0.2.3", 283 | "assert-plus": "^1.0.0", 284 | "bcrypt-pbkdf": "^1.0.0", 285 | "dashdash": "^1.12.0", 286 | "ecc-jsbn": "~0.1.1", 287 | "getpass": "^0.1.1", 288 | "jsbn": "~0.1.0", 289 | "safer-buffer": "^2.0.2", 290 | "tweetnacl": "~0.14.0" 291 | } 292 | }, 293 | "tough-cookie": { 294 | "version": "2.4.3", 295 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", 296 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", 297 | "requires": { 298 | "psl": "^1.1.24", 299 | "punycode": "^1.4.1" 300 | }, 301 | "dependencies": { 302 | "punycode": { 303 | "version": "1.4.1", 304 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 305 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 306 | } 307 | } 308 | }, 309 | "tunnel-agent": { 310 | "version": "0.6.0", 311 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 312 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 313 | "requires": { 314 | "safe-buffer": "^5.0.1" 315 | } 316 | }, 317 | "tweetnacl": { 318 | "version": "0.14.5", 319 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 320 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 321 | }, 322 | "uri-js": { 323 | "version": "4.2.2", 324 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 325 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 326 | "requires": { 327 | "punycode": "^2.1.0" 328 | } 329 | }, 330 | "uuid": { 331 | "version": "3.3.2", 332 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 333 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 334 | }, 335 | "verror": { 336 | "version": "1.10.0", 337 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 338 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 339 | "requires": { 340 | "assert-plus": "^1.0.0", 341 | "core-util-is": "1.0.2", 342 | "extsprintf": "^1.2.0" 343 | } 344 | } 345 | } 346 | } 347 | -------------------------------------------------------------------------------- /yargs/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notes-node", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ansi-regex": { 8 | "version": "3.0.0", 9 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 10 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" 11 | }, 12 | "camelcase": { 13 | "version": "4.1.0", 14 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", 15 | "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" 16 | }, 17 | "cliui": { 18 | "version": "4.1.0", 19 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", 20 | "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", 21 | "requires": { 22 | "string-width": "^2.1.1", 23 | "strip-ansi": "^4.0.0", 24 | "wrap-ansi": "^2.0.0" 25 | } 26 | }, 27 | "code-point-at": { 28 | "version": "1.1.0", 29 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 30 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" 31 | }, 32 | "cross-spawn": { 33 | "version": "6.0.5", 34 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", 35 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", 36 | "requires": { 37 | "nice-try": "^1.0.4", 38 | "path-key": "^2.0.1", 39 | "semver": "^5.5.0", 40 | "shebang-command": "^1.2.0", 41 | "which": "^1.2.9" 42 | } 43 | }, 44 | "decamelize": { 45 | "version": "2.0.0", 46 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", 47 | "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", 48 | "requires": { 49 | "xregexp": "4.0.0" 50 | } 51 | }, 52 | "execa": { 53 | "version": "0.10.0", 54 | "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", 55 | "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", 56 | "requires": { 57 | "cross-spawn": "^6.0.0", 58 | "get-stream": "^3.0.0", 59 | "is-stream": "^1.1.0", 60 | "npm-run-path": "^2.0.0", 61 | "p-finally": "^1.0.0", 62 | "signal-exit": "^3.0.0", 63 | "strip-eof": "^1.0.0" 64 | } 65 | }, 66 | "find-up": { 67 | "version": "3.0.0", 68 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", 69 | "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", 70 | "requires": { 71 | "locate-path": "^3.0.0" 72 | } 73 | }, 74 | "get-caller-file": { 75 | "version": "1.0.3", 76 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", 77 | "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" 78 | }, 79 | "get-stream": { 80 | "version": "3.0.0", 81 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", 82 | "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" 83 | }, 84 | "invert-kv": { 85 | "version": "2.0.0", 86 | "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", 87 | "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" 88 | }, 89 | "is-fullwidth-code-point": { 90 | "version": "2.0.0", 91 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 92 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" 93 | }, 94 | "is-stream": { 95 | "version": "1.1.0", 96 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 97 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" 98 | }, 99 | "isexe": { 100 | "version": "2.0.0", 101 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 102 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" 103 | }, 104 | "lcid": { 105 | "version": "2.0.0", 106 | "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", 107 | "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", 108 | "requires": { 109 | "invert-kv": "^2.0.0" 110 | } 111 | }, 112 | "loadash": { 113 | "version": "1.0.0", 114 | "resolved": "https://registry.npmjs.org/loadash/-/loadash-1.0.0.tgz", 115 | "integrity": "sha512-xlX5HBsXB3KG0FJbJJG/3kYWCfsCyCSus3T+uHVu6QL6YxAdggmm3QeyLgn54N2yi5/UE6xxL5ZWJAAiHzHYEg==" 116 | }, 117 | "locate-path": { 118 | "version": "3.0.0", 119 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", 120 | "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", 121 | "requires": { 122 | "p-locate": "^3.0.0", 123 | "path-exists": "^3.0.0" 124 | } 125 | }, 126 | "lodash": { 127 | "version": "4.17.11", 128 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 129 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 130 | }, 131 | "map-age-cleaner": { 132 | "version": "0.1.2", 133 | "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", 134 | "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", 135 | "requires": { 136 | "p-defer": "^1.0.0" 137 | } 138 | }, 139 | "mem": { 140 | "version": "4.0.0", 141 | "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", 142 | "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", 143 | "requires": { 144 | "map-age-cleaner": "^0.1.1", 145 | "mimic-fn": "^1.0.0", 146 | "p-is-promise": "^1.1.0" 147 | } 148 | }, 149 | "mimic-fn": { 150 | "version": "1.2.0", 151 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", 152 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" 153 | }, 154 | "nice-try": { 155 | "version": "1.0.5", 156 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", 157 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" 158 | }, 159 | "npm-run-path": { 160 | "version": "2.0.2", 161 | "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", 162 | "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", 163 | "requires": { 164 | "path-key": "^2.0.0" 165 | } 166 | }, 167 | "number-is-nan": { 168 | "version": "1.0.1", 169 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 170 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 171 | }, 172 | "os-locale": { 173 | "version": "3.0.1", 174 | "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", 175 | "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", 176 | "requires": { 177 | "execa": "^0.10.0", 178 | "lcid": "^2.0.0", 179 | "mem": "^4.0.0" 180 | } 181 | }, 182 | "p-defer": { 183 | "version": "1.0.0", 184 | "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", 185 | "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" 186 | }, 187 | "p-finally": { 188 | "version": "1.0.0", 189 | "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", 190 | "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" 191 | }, 192 | "p-is-promise": { 193 | "version": "1.1.0", 194 | "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", 195 | "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" 196 | }, 197 | "p-limit": { 198 | "version": "2.0.0", 199 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", 200 | "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", 201 | "requires": { 202 | "p-try": "^2.0.0" 203 | } 204 | }, 205 | "p-locate": { 206 | "version": "3.0.0", 207 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", 208 | "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", 209 | "requires": { 210 | "p-limit": "^2.0.0" 211 | } 212 | }, 213 | "p-try": { 214 | "version": "2.0.0", 215 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", 216 | "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" 217 | }, 218 | "path-exists": { 219 | "version": "3.0.0", 220 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", 221 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" 222 | }, 223 | "path-key": { 224 | "version": "2.0.1", 225 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", 226 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" 227 | }, 228 | "require-directory": { 229 | "version": "2.1.1", 230 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 231 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" 232 | }, 233 | "require-main-filename": { 234 | "version": "1.0.1", 235 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", 236 | "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" 237 | }, 238 | "semver": { 239 | "version": "5.5.1", 240 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", 241 | "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==" 242 | }, 243 | "set-blocking": { 244 | "version": "2.0.0", 245 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 246 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" 247 | }, 248 | "shebang-command": { 249 | "version": "1.2.0", 250 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 251 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 252 | "requires": { 253 | "shebang-regex": "^1.0.0" 254 | } 255 | }, 256 | "shebang-regex": { 257 | "version": "1.0.0", 258 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 259 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" 260 | }, 261 | "signal-exit": { 262 | "version": "3.0.2", 263 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 264 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" 265 | }, 266 | "string-width": { 267 | "version": "2.1.1", 268 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 269 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 270 | "requires": { 271 | "is-fullwidth-code-point": "^2.0.0", 272 | "strip-ansi": "^4.0.0" 273 | } 274 | }, 275 | "strip-ansi": { 276 | "version": "4.0.0", 277 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 278 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 279 | "requires": { 280 | "ansi-regex": "^3.0.0" 281 | } 282 | }, 283 | "strip-eof": { 284 | "version": "1.0.0", 285 | "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", 286 | "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" 287 | }, 288 | "which": { 289 | "version": "1.3.1", 290 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 291 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 292 | "requires": { 293 | "isexe": "^2.0.0" 294 | } 295 | }, 296 | "which-module": { 297 | "version": "2.0.0", 298 | "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", 299 | "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" 300 | }, 301 | "wrap-ansi": { 302 | "version": "2.1.0", 303 | "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", 304 | "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", 305 | "requires": { 306 | "string-width": "^1.0.1", 307 | "strip-ansi": "^3.0.1" 308 | }, 309 | "dependencies": { 310 | "ansi-regex": { 311 | "version": "2.1.1", 312 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 313 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 314 | }, 315 | "is-fullwidth-code-point": { 316 | "version": "1.0.0", 317 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 318 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 319 | "requires": { 320 | "number-is-nan": "^1.0.0" 321 | } 322 | }, 323 | "string-width": { 324 | "version": "1.0.2", 325 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 326 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 327 | "requires": { 328 | "code-point-at": "^1.0.0", 329 | "is-fullwidth-code-point": "^1.0.0", 330 | "strip-ansi": "^3.0.0" 331 | } 332 | }, 333 | "strip-ansi": { 334 | "version": "3.0.1", 335 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 336 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 337 | "requires": { 338 | "ansi-regex": "^2.0.0" 339 | } 340 | } 341 | } 342 | }, 343 | "xregexp": { 344 | "version": "4.0.0", 345 | "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", 346 | "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==" 347 | }, 348 | "y18n": { 349 | "version": "4.0.0", 350 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", 351 | "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" 352 | }, 353 | "yargs": { 354 | "version": "12.0.2", 355 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz", 356 | "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==", 357 | "requires": { 358 | "cliui": "^4.0.0", 359 | "decamelize": "^2.0.0", 360 | "find-up": "^3.0.0", 361 | "get-caller-file": "^1.0.1", 362 | "os-locale": "^3.0.0", 363 | "require-directory": "^2.1.1", 364 | "require-main-filename": "^1.0.1", 365 | "set-blocking": "^2.0.0", 366 | "string-width": "^2.0.0", 367 | "which-module": "^2.0.0", 368 | "y18n": "^3.2.1 || ^4.0.0", 369 | "yargs-parser": "^10.1.0" 370 | } 371 | }, 372 | "yargs-parser": { 373 | "version": "10.1.0", 374 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", 375 | "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", 376 | "requires": { 377 | "camelcase": "^4.1.0" 378 | } 379 | } 380 | } 381 | } 382 | --------------------------------------------------------------------------------