Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dropped auto-init, can now supply init callbacks

  • Loading branch information...
commit 1a6c20dcb71a111cdb0b940d023533aec7c3c656 1 parent ee5a866
Michael Pearson authored
Showing with 13 additions and 17 deletions.
  1. +12 −16 index.js
  2. +1 −1  package.json
28 index.js
View
@@ -322,26 +322,22 @@ TLD_TOOLS = {
} );
},
- init: function() {
+ init: function(success, fail) {
var self = this;
- var successFunc = function() {
- //console.log(self._tldCacheStruct);
- console.log('TLD Cache is UP');
- }
-
- var failFunc = function(errorBody) {
- if (undefined != errorBody) {
- console.log(errorBody);
- }
- console.log('TLD Cache could not be synced');
- }
this._syncTLDList( {
- 'onSuccess': successFunc,
- 'onFail' : failFunc
- } );
+ 'onSuccess': success || function() {
+ console.log('TLD Cache is UP');
+ },
+ 'onFail' : fail || function(errorBody) {
+ if (undefined != errorBody) {
+ console.log(errorBody);
+ }
+ console.log('TLD Cache could not be synced');
+ }
+ });
return this;
}
}
-module.exports = TLD_TOOLS.init();
+module.exports = TLD_TOOLS;
2  package.json
View
@@ -1,7 +1,7 @@
{
"name": "tldtools",
"description": "Extracts a domain into its component parts (node-url wrapper), performs domain inspection functions",
- "version": "0.0.7",
+ "version": "0.0.8",
"maintainers": [
{
"name": "Michael Pearson",
Please sign in to comment.
Something went wrong with that request. Please try again.