npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

check-ens

v0.1.15

Published

This repository contains various test scripts to verify the functionality of the ENS validator module.

Readme

ENS Validator Module Test Suite

This repository contains various test scripts to verify the functionality of the ENS validator module.

Prerequisites

Before running the tests, make sure you have Node.js installed and install the required dependencies:

npm install

Available Test Scripts

The following test scripts are available:

1. Basic Test

Runs basic tests without any mocking, which will make actual API calls:

npm test

2. Mocked Test

Runs tests with mocked HTTP requests to prevent actual API calls:

npm run test:mock

3. Jest Test Suite

Runs comprehensive tests using the Jest testing framework:

npm run test:jest

Test Files

  • test.js - Basic test script that makes actual API calls
  • test-with-mock.js - Tests with mocked HTTP requests using Nock
  • jest-test.js - Jest test suite with more comprehensive mocking and assertions

Important Notes

  • The mocked tests will not send any actual requests to external APIs
  • The basic test (test.js) will make actual API calls, which might result in real data being sent
  • If you're testing in a production environment, always use the mocked tests

Troubleshooting

If you encounter any issues running the tests:

  1. Make sure all dependencies are installed
  2. Check that the module path is correct in the test files
  3. Ensure you have proper network connectivity for the non-mocked tests

This is a very simple npm module.

My Module

A brief description of my module.

Installation

npm install check-ens

Usage

JavaScript

const { validateENS } = require('check-ens');

// Example usage with async/await
async function example() {
  try {
    const result = await validateENS('example.eth');
    console.log('Validation result:', result);
  } catch (error) {
    console.error('Validation error:', error);
  }
}

example();

TypeScript

The package includes TypeScript declarations:

import { validateENS, ValidationResponse } from 'check-ens';

// Example usage with async/await
async function example() {
  try {
    const result: ValidationResponse = await validateENS('example.eth');
    console.log('Validation result:', result);
    
    // Access typed properties
    if (result.success) {
      console.log('Message:', result.message);
    } else {
      console.error('Error:', result.error);
    }
  } catch (error) {
    console.error('Validation error:', error);
  }
}

example();

API

validateENS(data: string): Promise

Validates an ENS name or processes text data.

  • Parameters:

    • data (string): The text or ENS name to validate.
  • Returns:

    • Promise: A promise that resolves to the validation result.

Types

interface ValidationResponse {
  success?: boolean;
  message?: string;
  result?: any;
  error?: string;
  [key: string]: any; // Additional properties
}