{"library":"neverbounce","title":"NeverBounce Node.js API Wrapper","description":"The `neverbounce` package is the official Node.js wrapper for the NeverBounce email verification API, currently at version 5.0.5. It provides a robust, type-safe interface for integrating email validation services into server-side applications. Since its complete rewrite in version 5.0.0, the library has embraced modern JavaScript development practices, including full TypeScript support with comprehensive type definitions for both requests and responses. It exclusively uses ES Modules for import/export syntax and leverages the native `fetch` API for network requests, departing from older CommonJS and `https` module usage. The release cadence appears active, with recent patch releases demonstrating ongoing maintenance for the v5 branch. Key differentiators include its official backing by NeverBounce, strong typing, and adherence to contemporary Node.js standards, making it a reliable choice for server-side email validation tasks. It explicitly warns against browser usage, emphasizing its server-only nature.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install neverbounce"],"cli":null},"imports":["import NeverBounce from 'neverbounce';","import NeverBounce from 'neverbounce';\n// ... then access NeverBounce.result.valid","import NeverBounce from 'neverbounce';\n// ... then catch errors and check `err.type === NeverBounce.errors.AuthError`"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import NeverBounce from 'neverbounce';\n\n// Initialize NeverBounce client with your API key\nconst client = new NeverBounce({ apiKey: process.env.NEVERBOUNCE_API_KEY ?? '' });\n\nasync function verifyEmail() {\n  try {\n    // Verify an email, requesting address_info and credits_info\n    const result = await client.single.check('support@neverbounce.com', true, true);\n    \n    console.log('Verification Result: ' + result.getResult());\n    console.log('Numeric Result: ' + result.getNumericResult());\n    console.log('Is Valid? ' + result.is(NeverBounce.result.valid));\n    \n    const response = result.getResponse();\n    \n    if (response.address_info) {\n      console.log('Email Host: ' + response.address_info.host);\n    }\n    \n    if (response.credits_info) {\n      console.log('Free Credits Used: ' + response.credits_info.free_credits_used);\n      console.log('Paid Credits Used: ' + response.credits_info.paid_credits_used);\n    }\n  } catch (err) {\n    if (err instanceof Error) {\n      switch(err.type) {\n        case NeverBounce.errors.AuthError:\n          console.error('Authentication Error: Invalid API credentials.');\n          break;\n        case NeverBounce.errors.ThrottleError:\n          console.warn('Throttle Error: Too many requests, retrying shortly.');\n          break;\n        case NeverBounce.errors.GeneralError:\n          console.error('General API Error: ' + err.message);\n          break;\n        default:\n          console.error('An unexpected error occurred: ' + err.message);\n      }\n    } else {\n      console.error('An unknown error occurred:', err);\n    }\n  }\n}\n\nverifyEmail();","lang":"typescript","description":"This quickstart demonstrates how to initialize the NeverBounce client, perform an email verification, access detailed results and response data, and handle various API-specific errors using async/await.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}