[//]: #@corifeus-header
[](https://travis-ci.org/patrikx3/freenom) [](https://scrutinizer-ci.com/g/patrikx3/freenom/?branch=master) [](https://scrutinizer-ci.com/g/patrikx3/freenom/?branch=master)
[](https://www.npmjs.com/package/p3x-freenom/)
---
# Freenom API - Promise and auto renew expiring domains v1.0.447-268
This is an open source project. Just code. If you like this code, please add a star in GitHub and if you really like, you can donate as well. Thanks you so much!
Given, I have my own server, with dynamic IP address, it could happen that the server for about max 5 minutes can not be reachable for the dynamic DNS or very rarely I backup with Clonzilla the SSD or something with the electricity (too much hoovering or cleaning - but I worked on it, so should not happen again), but for some reason, it is not reachable please hang on for 5-30 minutes and it will be back for sure.
All my domains (patrikx3.com and corifeus.com) could have errors right now, since I am developing in my free time and you can catch glitches, but usually it is stable (imagine updating everything always, which is weird).
### Node Version Requirement
```
>=8.9.0
```
### Built on Node
```
v9.8.0
```
The ```async``` and ```await``` keywords are required.
Install NodeJs:
https://nodejs.org/en/download/package-manager/
# Description
[//]: #@corifeus-header:end
# Freenom API
http://www.freenom.com/en/freenom-api.html
I am using these only right now. So no other functions but very easy to add in and Promise based.
```javascript
const Freenom = require('p3x-freenom');
const freenom = await Freenom({
email: 'p3x@corifeus',
password: 'password',
});
await freenom.service.ping();
await freenom.domain.search({
domainname: 'patrikx3.com',
domaintype: 'FREE'
})
await freenom.domain.delete({ domainname: 'random.tk'));
await freenom.domain.register({
domainname: [
'random.tk',
'random1.tk',
'random2.tk',
],
domaintype: 'FREE',
period: '1Y',
nameserver: [
'ns1.ns.tk',
'ns2.ns.tk',
]
})
await freenom.domain.delete, { domainname: domains })
await freenom.domain.list()
```
# The good extra functions
It automatically renew the free domains (it checks if it is within 14 days expiry and the do it).
```javascript
// just a helper, you don't relly need it
const renewable = await freenom.domain.expiring({
expiry: '60 days',
});
// the magic
await freenom.domain.expiringRenew({
period: '12M',
})
```
[//]: #@corifeus-footer
---
[**P3X-FREENOM**](https://pages.corifeus.com/freenom) Build v1.0.447-268
[](https://www.facebook.com/corifeus.software) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact)
## Sponsor
[](https://www.jetbrains.com/)
[//]: #@corifeus-footer:end