├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | lib/ 3 | src/ 4 | 5 | tsconfig.json 6 | package-lock.json -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Binsar Dwi Jasuma 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Node Email Extractor 2 | 3 | [![npm](https://nodei.co/npm/node-email-extractor.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/alexa-rank-nodejs) 4 | 5 | ![npm version](https://img.shields.io/npm/v/node-email-extractor) 6 | ![lisence](https://img.shields.io/npm/l/node-email-extractor) 7 | [![issues](https://img.shields.io/github/issues/binsarjr/node-email-extractor)](https://github.com/binsarjr/node-email-extractor/issues) 8 | ![downloads month](https://img.shields.io/npm/dm/node-email-extractor) 9 | ![downloads](https://img.shields.io/npm/dt/node-email-extractor) 10 | 11 | 12 | Extract emails from text and also from a site page 13 | 14 | # Includes 15 | - [request-promise-native](https://www.npmjs.com/package/request-promise-native) 16 | 17 | # Requirements 18 | - [NodeJS](https://nodejs.org/en/download/) 19 | - [npm](https://www.npmjs.com/) 20 | 21 | # Instalation 22 | Instalation is done using `npm install` command 23 | ``` 24 | $ npm install node-email-extractor 25 | ``` 26 | 27 | # Feutures 28 | - Extract email from plaintext 29 | - Extract emails from website content 30 | - this module already supports [typescript](https://www.typescriptlang.org/) 31 | 32 | # Usage 33 | ### javascript 34 | ```js 35 | const email = require('node-email-extractor').default; 36 | 37 | (async () => { 38 | var data = await email.url('https://www.****.com/contact-us/') 39 | console.log(data); 40 | })() 41 | 42 | var data = email.text(`Contact Details 43 | Phone: +267 72301363 / 73316322 44 | 45 | Email: kumindaculture@gmail.com 46 | 47 | Registered with: `) 48 | 49 | console.log(data) 50 | ``` 51 | 52 | 53 | ### typescript 54 | ```js 55 | import EmailExtractor from "node-email-extractor"; 56 | 57 | (async () => { 58 | var data = await EmailExtractor.url('https://www.****.com/contact-us/') 59 | console.log(data); 60 | })() 61 | 62 | var data = EmailExtractor.text(`Contact Details 63 | Phone: +267 72301363 / 73316322 64 | 65 | Email: kumindaculture@gmail.com 66 | 67 | Registered with: `) 68 | 69 | console.log(data) 70 | 71 | ``` 72 | 73 | ### results 74 | ```js 75 | { domains: [ 'gmail.com' ], emails: [ 'kumindaculture@gmail.com' ] } 76 | { domains: [ 'gmail.com' ], emails: [ 'kumindaculture@gmail.com' ] } 77 | ``` 78 | Yes, it's really all you need to get started, Thank You ❤️ -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | console.log('hello') 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-email-extractor", 3 | "version": "1.0.2", 4 | "description": "Extract emails from text and also from a site page", 5 | "main": "./lib/index.js", 6 | "types": "./lib", 7 | "directories": { 8 | "lib": "lib" 9 | }, 10 | "dependencies": { 11 | "request": "^2.88.0", 12 | "request-promise-native": "^1.0.8", 13 | "typescript": "^3.7.3", 14 | "typings": "^2.1.1" 15 | }, 16 | "devDependencies": {}, 17 | "scripts": { 18 | "watch": "tsc -w", 19 | "build": "rm -rf ./lib && tsc -p ." 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/binsarjr/node-email-extractor.git" 24 | }, 25 | "keywords": [ 26 | "email", 27 | "extractor", 28 | "scraper", 29 | "crawler", 30 | "email-extractor", 31 | "email-scraper", 32 | "email-crawler", 33 | "node-email-extractor" 34 | ], 35 | "author": "Binsar Dwi Jasuma", 36 | "license": "ISC", 37 | "bugs": { 38 | "url": "https://github.com/binsarjr/node-email-extractor/issues" 39 | }, 40 | "homepage": "https://github.com/binsarjr/node-email-extractor#readme" 41 | } 42 | --------------------------------------------------------------------------------