@anclp/emailverifier 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/index.js ADDED
@@ -0,0 +1,19 @@
1
+ const koffi = require('koffi');
2
+ const path = require('path');
3
+
4
+
5
+ const extenstion=process.platform === 'win32' ? 'dll' : process.platform === 'darwin' ? 'dylib' : 'so';
6
+ const libPath = path.join(__dirname, `libverifier.${extenstion}`);
7
+
8
+ const lib = koffi.load(libPath);
9
+
10
+
11
+ const Verify = lib.func('int Verify(const char *)');
12
+
13
+ function verifyEmail(email) {
14
+ return Verify(email);
15
+ }
16
+
17
+ module.exports = {
18
+ verifyEmail
19
+ };
package/libverifier.h ADDED
@@ -0,0 +1,86 @@
1
+ /* Code generated by cmd/cgo; DO NOT EDIT. */
2
+
3
+ /* package github.com/jay6909/go_email_verifier */
4
+
5
+
6
+ #line 1 "cgo-builtin-export-prolog"
7
+
8
+ #include <stddef.h>
9
+
10
+ #ifndef GO_CGO_EXPORT_PROLOGUE_H
11
+ #define GO_CGO_EXPORT_PROLOGUE_H
12
+
13
+ #ifndef GO_CGO_GOSTRING_TYPEDEF
14
+ typedef struct { const char *p; ptrdiff_t n; } _GoString_;
15
+ #endif
16
+
17
+ #endif
18
+
19
+ /* Start of preamble from import "C" comments. */
20
+
21
+
22
+ #line 3 "main.go"
23
+
24
+ #include <stdlib.h>
25
+
26
+ #line 1 "cgo-generated-wrapper"
27
+
28
+
29
+ /* End of preamble from import "C" comments. */
30
+
31
+
32
+ /* Start of boilerplate cgo prologue. */
33
+ #line 1 "cgo-gcc-export-header-prolog"
34
+
35
+ #ifndef GO_CGO_PROLOGUE_H
36
+ #define GO_CGO_PROLOGUE_H
37
+
38
+ typedef signed char GoInt8;
39
+ typedef unsigned char GoUint8;
40
+ typedef short GoInt16;
41
+ typedef unsigned short GoUint16;
42
+ typedef int GoInt32;
43
+ typedef unsigned int GoUint32;
44
+ typedef long long GoInt64;
45
+ typedef unsigned long long GoUint64;
46
+ typedef GoInt64 GoInt;
47
+ typedef GoUint64 GoUint;
48
+ typedef size_t GoUintptr;
49
+ typedef float GoFloat32;
50
+ typedef double GoFloat64;
51
+ #ifdef _MSC_VER
52
+ #include <complex.h>
53
+ typedef _Fcomplex GoComplex64;
54
+ typedef _Dcomplex GoComplex128;
55
+ #else
56
+ typedef float _Complex GoComplex64;
57
+ typedef double _Complex GoComplex128;
58
+ #endif
59
+
60
+ /*
61
+ static assertion to make sure the file is being used on architecture
62
+ at least with matching size of GoInt.
63
+ */
64
+ typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
65
+
66
+ #ifndef GO_CGO_GOSTRING_TYPEDEF
67
+ typedef _GoString_ GoString;
68
+ #endif
69
+ typedef void *GoMap;
70
+ typedef void *GoChan;
71
+ typedef struct { void *t; void *v; } GoInterface;
72
+ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
73
+
74
+ #endif
75
+
76
+ /* End of boilerplate cgo prologue. */
77
+
78
+ #ifdef __cplusplus
79
+ extern "C" {
80
+ #endif
81
+
82
+ extern int Verify(char* cEmail);
83
+
84
+ #ifdef __cplusplus
85
+ }
86
+ #endif
package/libverifier.so ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@anclp/emailverifier",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "author": "",
13
+ "license": "ISC",
14
+ "description": "",
15
+ "dependencies": {
16
+ "koffi": "^2.16.0",
17
+ "ref-napi": "^3.0.3"
18
+ }
19
+ }
package/test.js ADDED
@@ -0,0 +1,8 @@
1
+ const { verifyEmail } = require(".");
2
+
3
+
4
+ //check good email
5
+ console.log(verifyEmail("test@example.com"));
6
+
7
+ //check bad email
8
+ console.log(verifyEmail("test@exampasase.com"));