{"id":16366,"library":"freemail","title":"freemail","description":"freemail is a Node.js module that provides a programmatic interface to identify whether an email domain is considered 'free' (e.g., gmail.com) or 'disposable' (e.g., mailinater.com). It ships with a database of domains categorized into `free.txt`, `disposable.txt`, and `blacklist.txt`. The package is currently at version 1.7.0. Its primary differentiator is the included, updateable domain database, which can be synchronized from various online sources. However, the project appears to be unmaintained, with its last update several years ago, meaning the included data may be significantly out of date unless manually refreshed by the user. There is no clear release cadence, and new development has ceased.","status":"abandoned","version":"1.7.0","language":"javascript","source_language":"en","source_url":"git://github.com/willwhite/freemail","tags":["javascript"],"install":[{"cmd":"npm install freemail","lang":"bash","label":"npm"},{"cmd":"yarn add freemail","lang":"bash","label":"yarn"},{"cmd":"pnpm add freemail","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a CommonJS module and does not natively support ES Module `import` syntax in modern Node.js environments without transpilation or specific loader configurations. The `require()` syntax is the only supported direct import method.","wrong":"import freemail from 'freemail';","symbol":"freemail","correct":"const freemail = require('freemail');"},{"note":"The `isFree` method is a property of the object exported by `freemail`. Using ES Module destructuring syntax for a CommonJS module will result in a runtime error.","wrong":"import { isFree } from 'freemail';","symbol":"isFree","correct":"const freemail = require('freemail');\nconst isFreeDomain = freemail.isFree('example@gmail.com');"},{"note":"While `const freemail = require('freemail')` and then `freemail.isDisposable()` is shown in examples, destructuring the properties directly from the `require` call, as shown in the correct example, is also a valid CommonJS pattern.","wrong":"import * as freemail from 'freemail';","symbol":"isDisposable","correct":"const { isDisposable } = require('freemail');\nconst isDisposableDomain = isDisposable('temp@mailinator.com');"}],"quickstart":{"code":"const freemail = require('freemail');\n\n// Example: Checking common free email domains\nconsole.log('Is gmail.com free?', freemail.isFree('user@gmail.com'));\nconsole.log('Is outlook.com free?', freemail.isFree('another@outlook.com'));\n\n// Example: Checking common disposable email domains\nconsole.log('Is mailinator.com disposable?', freemail.isDisposable('temp@mailinator.com'));\nconsole.log('Is yopmail.com disposable?', freemail.isDisposable('anon@yopmail.com'));\n\n// Example: Checking a standard corporate/personal domain (should be neither)\nconsole.log('Is mycompany.com free?', freemail.isFree('ceo@mycompany.com'));\nconsole.log('Is mycompany.com disposable?', freemail.isDisposable('ceo@mycompany.com'));\n\n// Demonstrating the full object structure (optional, for inspection)\n// console.log(Object.keys(freemail));","lang":"javascript","description":"This quickstart demonstrates how to use `freemail` to check if various email addresses belong to free or disposable email providers, illustrating its core functionality."},"warnings":[{"fix":"For ES Module projects, you must use `require()` through a compatibility layer or configure your build system (e.g., Webpack, Rollup) to handle CommonJS modules. The simplest approach for a pure Node.js ESM project is often to create a wrapper file that uses `require()` and then re-exports.","message":"The `freemail` package is a CommonJS module only. Attempting to `import` it directly in a native ES Module project will result in a runtime error (e.g., `ERR_REQUIRE_ESM`).","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Users must manually update the database by running the `./update` script provided within the package's `node_modules/freemail` directory. Be aware that this script itself may have outdated dependencies or fail due to changes in external data sources. For critical applications, consider alternatives or manually curating your own domain lists.","message":"The project appears to be abandoned, with no significant code updates or maintenance activity in several years. This means the underlying domain database (free.txt, disposable.txt) is likely outdated and may misclassify new or changed email providers.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Periodically inspect the `sources.txt` file and the `./update` script for potential issues. If the script fails, manual intervention may be required to fix the script or update the `sources.txt` to point to valid and current data providers.","message":"The `./update` script, which synchronizes the domain database, relies on external sources defined in `sources.txt`. These external sources may change their format, URL, or availability, causing the update script to fail or import malformed data.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For comprehensive coverage, users should augment the `freemail` database with their own lists or contribute updates to the project's GitHub repository, although contributions may not be merged due to project abandonment.","message":"The database only includes domains explicitly listed as free or disposable. New or less common free/disposable email providers might not be present, leading to false negatives.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Use `const freemail = require('freemail');` instead. If in a pure ESM file, consider a wrapper function or a dynamic import (e.g., `const freemail = await import('freemail');` if the package supports it, which this one likely doesn't without CJS interop).","cause":"Attempting to `import freemail from 'freemail'` in an ES Module context.","error":"ERR_REQUIRE_ESM"},{"fix":"Ensure `const freemail = require('freemail');` is used at the top level of a CommonJS file. Verify the package is correctly installed and accessible.","cause":"This error can occur if `freemail` is not correctly imported as an object with `isFree` and `isDisposable` methods, or if the `require` call failed silently.","error":"TypeError: freemail.isFree is not a function"},{"fix":"Manually inspect `node_modules/freemail/sources.txt` and the `node_modules/freemail/update` script. Update URLs, adapt parsing logic, or replace problematic sources to ensure successful data synchronization.","cause":"The `sources.txt` file may contain outdated URLs or the format of external domain lists has changed, breaking the parsing logic in the `update` script.","error":"Database update script './update' fails with network errors or parsing issues."}],"ecosystem":"npm"}