mailtesterninja
v1.1.1
Published
[![NPM Version](https://img.shields.io/npm/v/mailtesterninja.svg)](https://www.npmjs.com/package/mailtesterninja) [![License](https://img.shields.io/npm/l/mailtesterninja.svg)](https://www.npmjs.com/package/mailtesterninja) [![Build Status](https://img.
Downloads
21
Maintainers
Readme
MailTester Ninja - Email Verification Node.js Library
Overview
MailTester Ninja is a powerful Node.js library designed to interact with the MailTester Ninja email verification API. It allows developers to easily verify and validate email addresses within their applications, ensuring accurate and clean email lists.
Features
- Real-time Email Verification: Verify email addresses instantly to determine their validity.
- Batch Processing: Handle bulk email verification for larger lists.
- Detailed Reporting: Get comprehensive results, including the status of each email.
- Easy Integration: Simple and straightforward API, making it easy to integrate into any Node.js application.
Installation
You can install the mailtesterninja
package via npm:
npm install mailtesterninja --save
## Getting Started
To start using the MailTester Ninja library, you'll first need to sign up for an API key from [MailTester Ninja](https://mailtester.ninja). Once you have your API key, you can use it to initialize the library.
### Example Usage
const MailTesterNinja = require('mailtesterninja');
// Initialize the library with your API key
const mailTester = new MailTesterNinja('your-api-key-here');
// Verify a single email address
mailTester.verifyEmail('[email protected]')
.then(result => {
console.log(result);
// Output the verification result
})
.catch(error => {
console.error('Error verifying email:', error);
});
// Verify a batch of email addresses
const emails = ['[email protected]', '[email protected]', '[email protected]'];
mailTester.verifyBatch(emails)
.then(results => {
console.log(results);
// Output the batch verification results
})
.catch(error => {
console.error('Error verifying batch of emails:', error);
});
## API
### `verifyEmail(email: string): Promise<object>`
Verifies a single email address.
- **email:** The email address to be verified.
- **Returns:** A promise that resolves to an object containing the verification result.
### `verifyBatch(emails: string[]): Promise<object[]>`
Verifies a batch of email addresses.
- **emails:** An array of email addresses to be verified.
- **Returns:** A promise that resolves to an array of objects, each containing the verification result for an email address.
## Error Handling
If the API returns an error, the promise will be rejected with an error object. It's recommended to handle errors using `.catch()`.
## License
This library is licensed under the MIT License. See the LICENSE file for more details.
## Contributing
Contributions are welcome! Please submit a pull request or open an issue if you have any suggestions or improvements.
## Support
If you have any questions or need support, please contact us at [email protected].
## Acknowledgments
Thanks to all the contributors who have helped improve this library. Your efforts are greatly appreciated!
This `README.md` provides a comprehensive overview of the MailTester Ninja Node.js library, including installation instructions, usage examples, and API documentation. Adjust the content as needed to fit your actual package and features.