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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@namehash/nameai

v1.1.5

Published

A lightweight JavaScript client for the NameAI API.

Readme

NameAI SDK

NPM Version

NameAI extends NameGuard with sophisticated natural language processing capabilities to help evaluate and understand Ethereum Name Service (ENS) names.

NameGuard is designed to inspect and prevent malicious use of ENS names by providing comprehensive security checks. See the NameGuard SDK documentation for details about the base security features.

⚠️ This SDK is BETA. Things will change based on the community feedback.

API Implementation

This SDK provides a TypeScript interface to the NameAI API. Developers interested in the NameAI API internals can find the implementation in the NameAI backend service.

Features

Additional features provided by NameAI on top of NameGuard:

  • Natural Language Processing: Evaluate how well ENS names represent meaningful words or phrases
  • Tokenization: Break down names into meaningful word components with probability scoring
  • Purity Scoring: Assess the cleanliness and quality of ENS names
  • Sort Scoring: Get relative ranking scores for ENS names

The @namehash/nameai SDK provides full type-safety when working with the NameAI API.

Install

Install NameAI via npm, yarn or pnpm:

npm install @namehash/nameai

Usage

Import nameai:

import { nameai } from "@namehash/nameai";

Basic Name Inspection

Inspect a name:

const report = await nameai.inspectName("vitalik.eth");

// Example response:
{
  nameai: {
    // Quality score (0.0 to 1.0) for the first label
    purity_score: 0.29,
    
    // Ranking score (0.0 to 1.0) for the first label
    sort_score: 0.35,
    
    analysis: {  // undefined for uninspected names
      // The normalization status of the name (normalized, unnormalized, or unknown)
      status: "normalized",
      
      // Details about the inspected name component
      inspection: {
        label: "vitalik",
        // ... other inspection details
      },
      
      // Text meaningfulness (0.0 to 1.0)
      probability: 0.95,
      
      // Natural log of probability (≤ 0.0)
      log_probability: -0.05,
      
      // Minimum words in valid tokenizations
      word_count: 1,
      
      // Recommended word breakdown (may be undefined)
      top_tokenization: ["vitalik"],
      
      // All possible tokenizations (up to 1000)
      tokenizations: [
        {
          tokens: ["vitalik"],
          probability: 0.95,
          log_probability: -0.05
        }
      ]
    }
  },
  nameguard: NameGuardReport  // Standard NameGuard security inspection
}

Tokenization Inspection

The SDK provides detailed tokenization inspection:

const { nameai: { analysis } } = await nameai.inspectName("cryptowallet.eth");

console.log(analysis.top_tokenization); // ["crypto", "wallet"]
console.log(analysis.tokenizations); // Array of possible tokenizations with probabilities

Custom Client

You can create a custom client with different settings:

import { createClient } from "@namehash/nameai";

const nameai = createClient({
  nameaiEndpoint: "...",
  network: "sepolia"
});

Limitations

  • Maximum name length: 200 characters (including dots)
  • Maximum unknown labels: 5
  • Names exceeding these limits will have undefined analysis

Contact Us

Visit our website to get in contact.

License

Licensed under the MIT License, Copyright © 2023-present NameHash Labs.

See LICENSE for more information.