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

transip

v0.0.6

Published

Node.JS Promise-based library to communicate with the TransIP API

Downloads

21

Readme

node-transip

Node.JS Promise-based library to communicate with the TransIP API

This library creates a new instance of "TransIP" for you, exposing a few libraries and methods you can use to communicate.

Currently only the DomainService methods are supported

To start a new TransIP instance:

var TransIP = require('transip');

var transipInstance = new TransIP(login, privateKey);

login is your TransIP login username. An example of the privateKey can be found in config/data.example.js.

Enable the TransIP API

The TransIP API is disabled by default, you will have to enable it manually in the control panel. You can create a private key and whitelist your servers after.

Running the integration tests

Unfortunately, it's not possible or safe for me to publish my private keys so you can run my tests directly. You'll have to adapt the tests to your environment. I run these tests by hand, for now.

DomainService

transipInstance.domainService.batchCheckAvailability

transipInstance.domainService.batchCheckAvailability(['dualdev.com', 'sillevis.net']).then(function(domains) {
  // Returns array of domain object 
  // { 'name': 'domain.ext', 'status' 'unavailable|free', 'actions': {} }
});

transipInstance.domainService.checkAvailability

transipInstance.domainService.checkAvailability('dualdev.com').then(function(domain) {
  // Returns domain object
  // { 'name': 'domain.ext', 'status': 'unavailable|free', 'actions': {} }
});

transipInstance.domainService.getWhois

transipInstance.domainService.getWhois('dualdev.com').then(function(whois) {
  // Returns whois text (includes line breaks)
});

transipInstance.domainService.getDomainNames

transipInstance.domainService.getDomainNames().then(function(domains) {
  // Returns array of domain names
});

transipInstance.domainService.getInfo

transipInstance.domainService.getInfo('sillevis.net').then(function(info) {
  // Returns domain object
  // { 'nameservers': {}, 'contacts': {}, 'dnsEntries': {}, 'branding': {}, 'name': 'domain.ext', 'isLocked': 'true|false', 'registrationDate': /*unix timestamp*/ }
})

transipInstance.domainService.batchGetInfo

transipInstance.domainService.batchGetInfo(['sillevis.net', 'sierveld.me']).then(function(info) {
  // Returns domain objects
  // [{ 'nameservers': {}, 'contacts': {}, 'dnsEntries': {}, 'branding': {}, 'name': 'domain.ext', 'isLocked': 'true|false', 'registrationDate': /*unix timestamp*/ }]
});

transipInstance.domainService.getAuthCode

transipInstance.domainService.getAuthCode('sillevis.net').then(function(authCode) {
  // Returns authCode
  // 'authCode'
})

transipInstance.domainService.getIsLocked

transipInstance.domainService.getIsLocked('sillevis.net').then(function(isLocked) {
  // Returns lock status for domain
  // boolean
})

transipInstance.domainService.register

transipInstance.domainService.register({
  'name': 'sillevis-test2.nl',
  'nameservers': {
    'item': [{
      'hostname': 'ns01.dualdev.com',
      'ipv4': '',
      'ipv6': ''
    }, {
      'hostname': 'ns02.dualdev.com',
      'ipv4': '',
      'ipv6': ''
    }, {
      'hostname': 'ns03.dualdev.com',
      'ipv4': '',
      'ipv6': ''
    }]
  },
  'contacts': {
    'item': [{
      'type': 'registrant',
      'firstName': 'Chase',
      'middleName': null,
      'lastName': 'Sillevis',
      'companyName': 'DualDev',
      'companyKvk': '34372569',
      'companyType': 'VOF',
      'street': 'Ravelrode',
      'number': '37',
      'postalCode': '2717GD',
      'city': 'Zoetermeer',
      'phoneNumber': '+31612345678',
      'faxNumber': '',
      'email': '[email protected]',
      'country': 'NL' // Two letter code
    }, {
      'type': 'administrative',
      'firstName': 'René',
      'middleName': null,
      'lastName': 'van Sweeden',
      'companyName': 'DualDev',
      'companyKvk': '34372569',
      'companyType': 'VOF',
      'street': 'Ravelrode',
      'number': '37',
      'postalCode': '2717GD',
      'city': 'Zoetermeer',
      'phoneNumber': '+31612345678',
      'faxNumber': '',
      'email': '[email protected]',
      'country': 'NL' // Two letter code
    }, {
      'type': 'technical',
      'firstName': 'Chase',
      'middleName': null,
      'lastName': 'Sillevis',
      'companyName': 'DualDev',
      'companyKvk': '34372569',
      'companyType': 'VOF',
      'street': 'Ravelrode',
      'number': '37',
      'postalCode': '2717GD',
      'city': 'Zoetermeer',
      'phoneNumber': '+31612345678',
      'faxNumber': '',
      'email': '[email protected]',
      'country': 'NL' // Two letter code
    }]
  }
}).then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.cancel

Possible arguments for ending: end or immediately

transipInstance.domainService.cancel('sillevis.nl', 'end').then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.transferWithOwnerChange

transipInstance.domainService.transferWithOwnerChange({
  'name': 'sillevis-test2.nl',
  'contacts': {
    'item': [{
      'type': 'registrant',
      'firstName': 'Chase',
      'middleName': null,
      'lastName': 'Sillevis',
      'companyName': 'DualDev',
      'companyKvk': '34372569',
      'companyType': 'VOF',
      'street': 'Ravelrode',
      'number': '37',
      'postalCode': '2717GD',
      'city': 'Zoetermeer',
      'phoneNumber': '+31612345678',
      'faxNumber': '',
      'email': '[email protected]',
      'country': 'NL' // Two letter code
    }, {
      'type': 'administrative',
      'firstName': 'René',
      'middleName': null,
      'lastName': 'van Sweeden',
      'companyName': 'DualDev',
      'companyKvk': '34372569',
      'companyType': 'VOF',
      'street': 'Ravelrode',
      'number': '37',
      'postalCode': '2717GD',
      'city': 'Zoetermeer',
      'phoneNumber': '+31612345678',
      'faxNumber': '',
      'email': '[email protected]',
      'country': 'NL' // Two letter code
    }, {
      'type': 'technical',
      'firstName': 'Chase',
      'middleName': null,
      'lastName': 'Sillevis',
      'companyName': 'DualDev',
      'companyKvk': '34372569',
      'companyType': 'VOF',
      'street': 'Ravelrode',
      'number': '37',
      'postalCode': '2717GD',
      'city': 'Zoetermeer',
      'phoneNumber': '+31612345678',
      'faxNumber': '',
      'email': '[email protected]',
      'country': 'NL' // Two letter code
    }]
  }
}, '12345abcdef').then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.transferWithoutOwnerChange

transipInstance.domainService.transferWithoutOwnerChange({
  'name': 'sillevis-test3.nl'
}, 'authCode').then(function(response) {
  // Returns reponse
  // boolean
})

transipInstance.domainService.setNameservers

transipInstance.domainService.setNameservers('sillevis.net', {
  'hostname': 'dana.ns.cloudflare.com',
  'ipv4': '',
  'ipv6': ''
}, {
  'hostname': 'tim.ns.cloudflare.com',
  'ipv4': '',
  'ipv6': ''
}).then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.setLock

transipInstance.domainService.setLock('sillevis.net').then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.unsetLock

transipInstance.domainService.unsetLock('sillevis.net').then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.setDnsEntries

Please note that this function will replace all DNS entries

transipInstance.domainService.setDnsEntries('sillevis.net', {
  'item': [{
    'name': 'test',
    'expire': 10800,
    'type': 'CNAME',
    'content': 'lb.dualdev.com.' // Don't forget the "." at the end here, when using CNAME for example
  }]
}).then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.setOwner

transipInstance.domainService.setOwner('sillevis.net', {
  'type': 'registrant',
  'firstName': 'Chase',
  'middleName': null,
  'lastName': 'Sillevis',
  'companyName': 'DualDev',
  'companyKvk': '34372569',
  'companyType': 'VOF',
  'street': 'Ravelrode',
  'number': '37',
  'postalCode': '2717GD',
  'city': 'Zoetermeer',
  'phoneNumber': '+31612345678',
  'faxNumber': '',
  'email': '[email protected]',
  'country': 'NL' // Two letter code
}).then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.setContacts

transipInstance.domainService.setContacts('sillevis.net', {
  'item': [{
    'type': 'registrant',
    'firstName': 'Chase',
    'middleName': null,
    'lastName': 'Sillevis',
    'companyName': 'DualDev',
    'companyKvk': '34372569',
    'companyType': 'VOF',
    'street': 'Ravelrode',
    'number': '37',
    'postalCode': '2717GD',
    'city': 'Zoetermeer',
    'phoneNumber': '+31612345678',
    'faxNumber': '',
    'email': '[email protected]',
    'country': 'NL' // Two letter code
  }, {
    'type': 'administrative',
    'firstName': 'René',
    'middleName': null,
    'lastName': 'van Sweeden',
    'companyName': 'DualDev',
    'companyKvk': '34372569',
    'companyType': 'VOF',
    'street': 'Ravelrode',
    'number': '37',
    'postalCode': '2717GD',
    'city': 'Zoetermeer',
    'phoneNumber': '+31612345678',
    'faxNumber': '',
    'email': '[email protected]',
    'country': 'NL' // Two letter code
  }, {
    'type': 'technical',
    'firstName': 'Chase',
    'middleName': null,
    'lastName': 'Sillevis',
    'companyName': 'DualDev',
    'companyKvk': '34372569',
    'companyType': 'VOF',
    'street': 'Ravelrode',
    'number': '37',
    'postalCode': '2717GD',
    'city': 'Zoetermeer',
    'phoneNumber': '+31612345678',
    'faxNumber': '',
    'email': '[email protected]',
    'country': 'NL' // Two letter code
  }]
}).then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.getAllTldInfos

transipInstance.domainService.getAllTldInfos().then(function(response) {
  // Returns array with all TLD objects
  // [ { 'name': '.nl', 'price': '9.99', 'renewalPrice': '29', capabilities:
  //   [ 'canRegister',
  //     'canSetContacts',
  //     'canSetNameservers',
  //     'canSetOwner',
  //     'canTransferWithOwnerChange',
  //     'requiresAuthCode' ]} ],
  //   registrationPeriodLength: '12',
  //   cancelTimeFrame: '1' } ]
})

transipInstance.domainService.getTldInfo

transipInstance.domainService.getTldInfo('nl').then(function(response) {
  // Returns object with this TLDs info
  // { 'name': '.nl', 'price': '9.99', 'renewalPrice': '29', capabilities:
  //   [ 'canRegister',
  //     'canSetContacts',
  //     'canSetNameservers',
  //     'canSetOwner',
  //     'canTransferWithOwnerChange',
  //     'requiresAuthCode' ]} ],
  //   registrationPeriodLength: '12',
  //   cancelTimeFrame: '1' }
})

transipInstance.domainService.getCurrentDomainAction

transipInstance.domainService.getCurrentDomainAction('sillevis.net').then(function(response) {
  // Returns object with current domain action
  // { 'name': 'sillevis.net', 'message': null, 'hasFailed': 'false', 'status': null }
})

transipInstance.domainService.retryCurrentDomainActionWithNewData

transipInstance.domainService.retryCurrentDomainActionWithNewData({
  'name': 'sillevis.net'
}).then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.retryTransferWithDifferentAuthCode

transipInstance.domainService.retryTransferWithDifferentAuthCode({
  'name': 'sillevis-test4.nl'
}, '23456789').then(function(response) {
  // Returns response
  // boolean
})

transipInstance.domainService.cancelDomainAction

transipInstance.domainService.cancelDomainAction({
  'name': 'sierveld.me'
}).then(function(response) {
  // Returns response
  // boolean
})