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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rqt/namecheap

v2.4.2

Published

An Implementation Of The Namecheap.com API.

Downloads

181

Readme

namecheap

@rqt/namecheap

npm version

@rqt/namecheap is an implementation of the namecheap.com API.

yarn add @rqt/namecheap

Table Of Contents

API

The package is available by importing its default function:

import NameCheap from '@rqt/namecheap'

constructor(  options: Options,): void

Create a new instance of the NameCheap class.

Options: Options for the NameCheap client.

| Name | Type | Description | Default | | --------- | ---------------- | ----------------------------------------------------------------------------- | ------- | | user* | string | The username required to access the API. | - | | key* | string | The password required used to access the API. | - | | ip* | string | The IP address of the client accessing the application (End-user IP address). | - | | sandbox | boolean | Whether to use the sandbox version of the API. | false |

import NameCheap from '@rqt/namecheap'
import bosom from 'bosom'

(async () => {
  try {
    // 0. Create a client.
    const { user, key, ip } = await bosom('.namecheap.json')
    const namecheap = new NameCheap({
      user, key, sandbox: true, ip,
    })

    // 1. Check a domain.
    const c = await namecheap.domains.check('test.co')
    console.log('Check:', c, '\n')

    // 2. Get list of addresses on the account.
    const cc = await namecheap.address.getList()
    console.log('Addresses:', cc, '\n')

    // 3. Find the default address and get its info.
    const { AddressId } = cc.find(({ IsDefault }) => IsDefault)
    const address = await namecheap.address.getInfo(AddressId)

    // 4. Register the domain using the address.
    const d = new Date().toLocaleString().replace(/[ :]/g, '-')
    const domain = `rqt-example-${d}.com`
    const r = await namecheap.domains.create({
      domain,
      address,
    })
    console.log('Registered:', r, '\n')

    // 5. Retrieve info about domain.
    const info = await namecheap.domains.getInfo(domain)
    console.log('Info:', info, '\n')

    // 6. Get a list of domains (with filter).
    const list = await namecheap.domains.getList({
      filter: domain,
    })
    console.log('List:', list, '\n')
  } catch (err) {
    console.log(err)
  }
})()
Check: [ { Domain: 'test.co',
    Available: false,
    ErrorNo: 0,
    Description: '',
    IsPremiumName: false,
    PremiumRegistrationPrice: 0,
    PremiumRenewalPrice: 0,
    PremiumRestorePrice: 0,
    PremiumTransferPrice: 0,
    IcannFee: 0,
    EapFee: '0.0' } ] 

Addresses: [ { AddressId: 0,
    AddressName: 'Primary Address',
    IsDefault: false },
  { AddressId: 101235,
    AddressName: 'Planet Express',
    IsDefault: true } ] 

Registered: { Domain: 'rqt-example-2019-8-2-02-13-44.com',
  Registered: true,
  ChargedAmount: '9.0600',
  DomainID: 429348,
  OrderID: 1549920,
  TransactionID: 2120538,
  WhoisguardEnable: true,
  FreePositiveSSL: false,
  NonRealTimeDomain: false } 

Info: { Status: 'Ok',
  ID: 429348,
  DomainName: 'rqt-example-2019-8-2-02-13-44.com',
  OwnerName: 'zavr',
  IsOwner: true,
  IsPremium: false,
  DomainDetails: 
   { CreatedDate: '08/01/2019',
     ExpiredDate: '08/01/2020',
     NumYears: 0 },
  Whoisguard: 
   { Enabled: 'True',
     ID: 351830,
     ExpiredDate: '08/01/2020',
     EmailDetails: 
      { WhoisGuardEmail: '[email protected]',
        ForwardedTo: '[email protected]',
        LastAutoEmailChangeDate: '',
        AutoEmailChangeFrequencyDays: 3 } },
  PremiumDnsSubscription: 
   { UseAutoRenew: false,
     SubscriptionId: -1,
     CreatedDate: 0000-12-31T21:00:00.000Z,
     ExpirationDate: 0000-12-31T21:00:00.000Z,
     IsActive: false },
  DnsDetails: 
   { ProviderType: 'FREE',
     IsUsingOurDNS: true,
     HostCount: 2,
     EmailType: 'FWD',
     DynamicDNSStatus: false,
     IsFailover: false,
     Nameserver: [ 'dns1.registrar-servers.com', 'dns2.registrar-servers.com' ] },
  Modificationrights: { All: true } } 

List: { domains: 
   [ { ID: 429348,
       Name: 'rqt-example-2019-8-2-02-13-44.com',
       User: 'zavr',
       Created: '08/01/2019',
       Expires: '08/01/2020',
       IsExpired: false,
       IsLocked: false,
       AutoRenew: false,
       WhoisGuard: 'ENABLED',
       IsPremium: false,
       IsOurDNS: true } ],
  TotalItems: 1,
  CurrentPage: 1,
  PageSize: 20 }

domains

Methods to check availability, register and retrieve account domains' info. 🎟Read Domains Wiki

users

Methods related to the user. 👩‍💻Read Users Wiki

address

Methods to manipulate addresses. In contrast to the NameCheap API, it does not fall under the group users. 🏡Read Address Wiki

dns

Methods to work with DNS records, such as getting a list of current hosts, and setting a new list. 🗺Read DNS Wiki

Progress

  • domains: 4/11
  • domains.dns: 2/7
  • domains.ns: 0/4
  • domains.transfer: 0/4
  • ssl: 0/13
  • users: 1/9
  • users.address: 2/6
  • whoisguard: 0/8

9/62 = 15%

Copyright

(c) Rqt 2019