forked from fsystech/reqw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
42 lines (41 loc) · 1.35 KB
/
Copy pathindex.js
File metadata and controls
42 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// @ts-check
/**
* Copyright (c) 2018, SOW (https://www.safeonline.world). (https://github.com/RKTUXYN) All rights reserved.
* @author {SOW}
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
//By Rajib Chy
// On 11:00 AM 12/25/2020
/**
* @typedef {import('./index').IHttpConfig} IHttpConfig
*/
const path = require('path');
// const os = require("os");
// const fs = require('fs');
// const { Writable } = require('stream');
// const { ServerResponse } = require('http');
/**
* Import PDF Native Module
* @returns {import('./index').reqw_native}
*/
function import_module() {
let binding_path;
if (process.env.LUNCH_MODE === "DEBUG") {
binding_path = "./build/Release/reqw.node";
} else {
binding_path = require('node-pre-gyp').find(path.resolve(path.join(__dirname, './package.json')));
}
return require(binding_path).reqw;
}
const reqwn = import_module();
const http = require('./http');
http.nativeInit(reqwn.create_http_request);
module.exports.HttpRequest = http.HttpRequest;
const smtp = require('./smtp');
smtp.nativeInit(reqwn.create_smtp_request);
module.exports.SMTPRequest = smtp.SMTPRequest;
module.exports.MailMessage = smtp.MailMessage;
module.exports.TemplateParser = smtp.TemplateParser;
module.exports.mimeType = smtp.mimeType;
module.exports.mimeEncoder = smtp.mimeEncoder;