@digelo/domain-checker
v1.0.3
Published
Checks domain availability and sends email notifications if a domain becomes available.
Maintainers
Readme
Domain Checker
A Node.js/TypeScript tool to check domain availability and send email notifications when a domain becomes available.
Quick Start
- Clone the repository and install dependencies:
git clone https://github.com/yourusername/domain-checker.git cd domain-checker npm install - Copy and edit the environment file:
cp .env.example .env # Edit .env with your domain and email/SMTP details - Run the checker:
npm run build node dist/index.js # or, for TypeScript directly: npx ts-node index.ts
How it works
- The script checks the availability of the domain specified in your
.envfile using thewhoiscommand. - If the domain is available, it sends an email notification to the address you configure.
- All SMTP and notification settings are managed via environment variables for security and flexibility.
Features
- Checks domain availability using the
whoiscommand - Sends email notifications via SMTP (Gmail and others supported)
- Configurable via
.envfile - Fully tested with Jest
- TypeScript support
Setup
1. Clone and Install
git clone https://github.com/yourusername/domain-checker.git
cd domain-checker
npm install2. Configure Environment Variables
Copy .env.example to .env and fill in your details:
cp .env.example .envEdit .env:
DOMAIN=yourdomain.com
[email protected]
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
[email protected]
SMTP_PASS=your_app_passwordFor Gmail, use an App Password (see: https://support.google.com/accounts/answer/185833)
3. Run the Checker
npm run build # Compile TypeScript
node dist/index.jsOr directly with ts-node:
npx ts-node index.tsTesting
Run all tests with coverage:
npm testLinting
Lint and auto-fix code:
npx eslint --fix *.tsProject Structure
index.ts- Main checker logicindex.test.ts- Jest tests.env.example- Example environment configenv-loader.js- Loads .env at runtimepackage.json- Project configtsconfig.json- TypeScript configjest.config.js- Jest config
License
MIT
