fucking_pack 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/06-02.html +34 -0
 - package/06-02.js +39 -0
 - package/06-03.js +10 -0
 - package/06-04.js +9 -0
 - package/ex1//320/241/320/275/320/270/320/274/320/276/320/272 /321/215/320/272/321/200/320/260/320/275/320/260 2022-10-21 101119.png +0 -0
 - package/ex1//320/241/320/275/320/270/320/274/320/276/320/272 /321/215/320/272/321/200/320/260/320/275/320/260 2022-10-21 101304.png +0 -0
 - package/ex1//320/241/320/275/320/270/320/274/320/276/320/272 /321/215/320/272/321/200/320/260/320/275/320/260 2022-10-21 102706.png +0 -0
 - package/m0603.js +30 -0
 - package/package.json +16 -0
 
    
        package/06-02.html
    ADDED
    
    | 
         @@ -0,0 +1,34 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <!DOCTYPE html>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <html>
         
     | 
| 
      
 3 
     | 
    
         
            +
                <head>
         
     | 
| 
      
 4 
     | 
    
         
            +
                    <title>Excercise 2</title>
         
     | 
| 
      
 5 
     | 
    
         
            +
                </head>
         
     | 
| 
      
 6 
     | 
    
         
            +
                <body>
         
     | 
| 
      
 7 
     | 
    
         
            +
                    <h1>Lab 6</h1>
         
     | 
| 
      
 8 
     | 
    
         
            +
                    <form action="http://localhost:5000/" method="POST">
         
     | 
| 
      
 9 
     | 
    
         
            +
                        <div class='row'>
         
     | 
| 
      
 10 
     | 
    
         
            +
                            <label class="col-2">Sender</label>
         
     | 
| 
      
 11 
     | 
    
         
            +
                            <input id="sender" type="email" name="sender" value="kokokokukareku07@gmail.com"/>
         
     | 
| 
      
 12 
     | 
    
         
            +
                        </div>
         
     | 
| 
      
 13 
     | 
    
         
            +
                        <div class='row'>
         
     | 
| 
      
 14 
     | 
    
         
            +
                            <label class="col-2">Password</label>
         
     | 
| 
      
 15 
     | 
    
         
            +
                            <input id="password" type="password" name="password" value="nmkukybwgnmicrso"/>
         
     | 
| 
      
 16 
     | 
    
         
            +
                        </div>
         
     | 
| 
      
 17 
     | 
    
         
            +
                        <div class="row">
         
     | 
| 
      
 18 
     | 
    
         
            +
                            <label class="col-2">Reciever</label>
         
     | 
| 
      
 19 
     | 
    
         
            +
                            <input id="receiver" type="email" name="receiver" value="kokokokukareku07@gmail.com"/>
         
     | 
| 
      
 20 
     | 
    
         
            +
                        </div>
         
     | 
| 
      
 21 
     | 
    
         
            +
                        <div class="row">
         
     | 
| 
      
 22 
     | 
    
         
            +
                            <label class="col-2">Subject</label>
         
     | 
| 
      
 23 
     | 
    
         
            +
                            <input id="subject" type="text" name="subject" value="fkds"/>
         
     | 
| 
      
 24 
     | 
    
         
            +
                        </div>
         
     | 
| 
      
 25 
     | 
    
         
            +
                        <div class="row">
         
     | 
| 
      
 26 
     | 
    
         
            +
                            <label class="col-2">Message</label>
         
     | 
| 
      
 27 
     | 
    
         
            +
                            <input id="message" type="text" name="message" value="dsll;;"/>
         
     | 
| 
      
 28 
     | 
    
         
            +
                        </div>
         
     | 
| 
      
 29 
     | 
    
         
            +
                        <div class="row">
         
     | 
| 
      
 30 
     | 
    
         
            +
                            <button class="col-2">SEND</button>
         
     | 
| 
      
 31 
     | 
    
         
            +
                        </div>
         
     | 
| 
      
 32 
     | 
    
         
            +
                    </form>
         
     | 
| 
      
 33 
     | 
    
         
            +
                </body>
         
     | 
| 
      
 34 
     | 
    
         
            +
            </html>
         
     | 
    
        package/06-02.js
    ADDED
    
    | 
         @@ -0,0 +1,39 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            const nodemailer = require('nodemailer');
         
     | 
| 
      
 2 
     | 
    
         
            +
            const http = require('http');
         
     | 
| 
      
 3 
     | 
    
         
            +
            const url = require('url');
         
     | 
| 
      
 4 
     | 
    
         
            +
            const fs = require('fs');
         
     | 
| 
      
 5 
     | 
    
         
            +
            const { parse } = require('querystring');
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            let http_handler = (req, res)=>{
         
     | 
| 
      
 8 
     | 
    
         
            +
                res.writeHead(200, {'Content-Type':'text/html; charset=utf-8'});
         
     | 
| 
      
 9 
     | 
    
         
            +
                if(url.parse(req.url).pathname=='/' && req.method=='GET'){
         
     | 
| 
      
 10 
     | 
    
         
            +
                    res.end(fs.readFileSync('./06-02.html'));
         
     | 
| 
      
 11 
     | 
    
         
            +
                }else if(url.parse(req.url).pathname == '/' && req.method == 'POST'){
         
     | 
| 
      
 12 
     | 
    
         
            +
                    let body = '';
         
     | 
| 
      
 13 
     | 
    
         
            +
                    req.on('data', chunk => {body += chunk.toString();});
         
     | 
| 
      
 14 
     | 
    
         
            +
                    req.on('end', ()=>{
         
     | 
| 
      
 15 
     | 
    
         
            +
                        let parm = parse(body);
         
     | 
| 
      
 16 
     | 
    
         
            +
                        const transporter = nodemailer.createTransport({
         
     | 
| 
      
 17 
     | 
    
         
            +
                            host: 'smtp.gmail.com',
         
     | 
| 
      
 18 
     | 
    
         
            +
                            port: 465,
         
     | 
| 
      
 19 
     | 
    
         
            +
                            secure: false,
         
     | 
| 
      
 20 
     | 
    
         
            +
                            service: 'Gmail',
         
     | 
| 
      
 21 
     | 
    
         
            +
                            auth: {
         
     | 
| 
      
 22 
     | 
    
         
            +
                                user: parm.sender,
         
     | 
| 
      
 23 
     | 
    
         
            +
                                pass: parm.password
         
     | 
| 
      
 24 
     | 
    
         
            +
                            }
         
     | 
| 
      
 25 
     | 
    
         
            +
                        });
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                        transporter.sendMail({
         
     | 
| 
      
 28 
     | 
    
         
            +
                            from: parm.sender,
         
     | 
| 
      
 29 
     | 
    
         
            +
                            to: parm.receiver,
         
     | 
| 
      
 30 
     | 
    
         
            +
                            subject: parm.subject,
         
     | 
| 
      
 31 
     | 
    
         
            +
                            text: parm.message});
         
     | 
| 
      
 32 
     | 
    
         
            +
                            res.end(`<h2>Sender: ${parm.sender}</br>Reciever: ${parm.receiver}
         
     | 
| 
      
 33 
     | 
    
         
            +
                            </br>Subject: ${parm.subject}</br>Message: ${parm.message}</h2>`);
         
     | 
| 
      
 34 
     | 
    
         
            +
                    })
         
     | 
| 
      
 35 
     | 
    
         
            +
                } else res.end('<h1>Not support</h1>');
         
     | 
| 
      
 36 
     | 
    
         
            +
            };
         
     | 
| 
      
 37 
     | 
    
         
            +
            let server = http.createServer(http_handler);
         
     | 
| 
      
 38 
     | 
    
         
            +
            server.listen(5000);
         
     | 
| 
      
 39 
     | 
    
         
            +
            console.log('Welcome -> http://localhost:5000/');
         
     | 
    
        package/06-03.js
    ADDED
    
    | 
         @@ -0,0 +1,10 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            const http = require('http');
         
     | 
| 
      
 2 
     | 
    
         
            +
            const send = require('./m0603.js');
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            http.createServer((request, response) => {
         
     | 
| 
      
 5 
     | 
    
         
            +
                response.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
         
     | 
| 
      
 6 
     | 
    
         
            +
                send('Ilya, hello!!!');
         
     | 
| 
      
 7 
     | 
    
         
            +
                response.end('<h2>Message sucessfully sent.</h2>');
         
     | 
| 
      
 8 
     | 
    
         
            +
            }).listen(5000); 
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            console.log('Welcome -> http://localhost:5000/');
         
     | 
    
        package/06-04.js
    ADDED
    
    | 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            const send = require('C:/Users/valda/AppData/Roaming/npm/node_modules/secxmail');
         
     | 
| 
      
 2 
     | 
    
         
            +
            const http = require('http');
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            http.createServer((req, res) => {
         
     | 
| 
      
 5 
     | 
    
         
            +
                res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
         
     | 
| 
      
 6 
     | 
    
         
            +
                send('[06-04] hello from secxmail GLOBAL module!');
         
     | 
| 
      
 7 
     | 
    
         
            +
                res.end('<h2>Message sucessfully sent</h2>');
         
     | 
| 
      
 8 
     | 
    
         
            +
            }).listen(5000);
         
     | 
| 
      
 9 
     | 
    
         
            +
            console.log('Welcome -> http://localhost:5000/');
         
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
    
        package/m0603.js
    ADDED
    
    | 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            const nodemailer = require('nodemailer');
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            const sender = 'kokokokukareku07@gmail.com';
         
     | 
| 
      
 4 
     | 
    
         
            +
            const password = 'nmkukybwgnmicrso';
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            const transporter = nodemailer.createTransport({
         
     | 
| 
      
 8 
     | 
    
         
            +
                host: 'smtp.gmail.com',
         
     | 
| 
      
 9 
     | 
    
         
            +
                port: 465,
         
     | 
| 
      
 10 
     | 
    
         
            +
                secure: false,
         
     | 
| 
      
 11 
     | 
    
         
            +
                service: 'Gmail',
         
     | 
| 
      
 12 
     | 
    
         
            +
                auth: {
         
     | 
| 
      
 13 
     | 
    
         
            +
                    user: sender,
         
     | 
| 
      
 14 
     | 
    
         
            +
                    pass: password
         
     | 
| 
      
 15 
     | 
    
         
            +
                }
         
     | 
| 
      
 16 
     | 
    
         
            +
            });
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            send = (message) =>
         
     | 
| 
      
 20 
     | 
    
         
            +
            {
         
     | 
| 
      
 21 
     | 
    
         
            +
                transporter.sendMail(
         
     | 
| 
      
 22 
     | 
    
         
            +
                {
         
     | 
| 
      
 23 
     | 
    
         
            +
                    from: sender,
         
     | 
| 
      
 24 
     | 
    
         
            +
                    to: sender,
         
     | 
| 
      
 25 
     | 
    
         
            +
                    subject: 'Excercise 3-4',
         
     | 
| 
      
 26 
     | 
    
         
            +
                    text: message
         
     | 
| 
      
 27 
     | 
    
         
            +
                })
         
     | 
| 
      
 28 
     | 
    
         
            +
            }
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            module.exports = send;
         
     | 
    
        package/package.json
    ADDED
    
    | 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {
         
     | 
| 
      
 2 
     | 
    
         
            +
              "dependencies": {
         
     | 
| 
      
 3 
     | 
    
         
            +
                "nodemailer": "^6.8.0",
         
     | 
| 
      
 4 
     | 
    
         
            +
                "sendmail": "^1.6.1"
         
     | 
| 
      
 5 
     | 
    
         
            +
              },
         
     | 
| 
      
 6 
     | 
    
         
            +
              "name": "fucking_pack",
         
     | 
| 
      
 7 
     | 
    
         
            +
              "version": "1.0.0",
         
     | 
| 
      
 8 
     | 
    
         
            +
              "main": "m0603.js",
         
     | 
| 
      
 9 
     | 
    
         
            +
              "devDependencies": {},
         
     | 
| 
      
 10 
     | 
    
         
            +
              "scripts": {
         
     | 
| 
      
 11 
     | 
    
         
            +
                "test": "start"
         
     | 
| 
      
 12 
     | 
    
         
            +
              },
         
     | 
| 
      
 13 
     | 
    
         
            +
              "author": "",
         
     | 
| 
      
 14 
     | 
    
         
            +
              "license": "ISC",
         
     | 
| 
      
 15 
     | 
    
         
            +
              "description": ""
         
     | 
| 
      
 16 
     | 
    
         
            +
            }
         
     |