Assignment 1
Assignment 1
Abdul Moeed
FA19-BCS-003
—
BCS-VI(A)
—
Sir Rashid Mukhtar
1- Bcryptjs: Information encryption library.
console.log(bcrypt.compareSync("B4c0/\/", hash));
console.log(bcrypt.compareSync("not_bacon", hash));
console.log(hash);
console.log(salt);
Assignment-1 PAGE 2
3- Axios: Promise based HTTP client for the browser and node.js used at the client
side to connect with the server side and send http requests to the server.
console.log(data);
}
const payLoad = {
name: "Abdul Moeed",
regno: "003"
};
console.log(data);
makePostReq();
makeGetRequest();
Assignment-1 PAGE 3
import express from 'express';
import cors from 'cors';
app.use(cors());
app.listen(port, () => console.log("Backend server live on " + port));
console.log(user);
})
Assignment-1 PAGE 4
4- Dotenv: Dotenv is a zero-dependency module that loads environment variables
from a .env file into process.env. Storing configuration in the environment
separate from code. This also allows you to protect your credentials such as
database connection strings, port numbers etc.
if (result.error) {
throw result.error
}
console.log(result.parsed)
app.use(cors());
app.listen(port, () => console.log("Backend server live on " + port));
console.log(user);
})
Assignment-1 PAGE 5
5- Nodemailer: An api to send emails as easy as cake!
Assignment-1 PAGE 6
main().catch(console.error);
Assignment-1 PAGE 7
6- Moment: A lightweight JavaScript date library for parsing, validating,
manipulating, and formatting dates.
Assignment-1 PAGE 8
7- Cloudinary: The Cloudinary Node SDK allows you to quickly and easily
integrate your application with Cloudinary. Effortlessly optimize, transform,
upload and manage your cloud's assets.
console.log(myURL);
Assignment-1 PAGE 9
Assignment-1 PAGE 10
8- Chalk: Terminal string styling library to make debugging easier for server side.
// Nest styles
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
Assignment-1 PAGE 11
9- Node-nlp: A natural language processing library for node js to recognize human
speech.
10- import { NlpManager } from 'node-nlp';
11-
12- const manager = new NlpManager({ languages: ['en'], forceNER: true });
13- // Adds the utterances and intents for the NLP
14- manager.addDocument('en', 'goodbye for now', 'greetings.bye');
15- manager.addDocument('en', 'bye bye take care', 'greetings.bye');
16- manager.addDocument('en', 'okay see you later', 'greetings.bye');
17- manager.addDocument('en', 'bye for now', 'greetings.bye');
18- manager.addDocument('en', 'i must go', 'greetings.bye');
19- manager.addDocument('en', 'hello', 'greetings.hello');
20- manager.addDocument('en', 'hi', 'greetings.hello');
21- manager.addDocument('en', 'howdy', 'greetings.hello');
22-
23- // Train also the NLG
24- manager.addAnswer('en', 'greetings.bye', 'Till next time');
25- manager.addAnswer('en', 'greetings.bye', 'see you soon!');
26- manager.addAnswer('en', 'greetings.hello', 'Hey there!');
27- manager.addAnswer('en', 'greetings.hello', 'Greetings!');
28-
29- // Train and save the model.
30- (async() => {
31- await manager.train();
32- manager.save();
33- const response = await manager.process('en', 'I should go now');
34- console.log(response);
35- })();
Assignment-1 PAGE 12
Assignment-1 PAGE 13
10- npm-login-register: A library to implement basic and simplistic login and
registration functionality in your application. This library can also be used for testing
frontend before connecting it to the backend.
const data = {
email: "[email protected]",
name: "hehe",
password: 694200
};
Assignment-1 PAGE 14
Assignment-1 PAGE 15