node.js - Closing out Dropbox Datastore API in NodeJS -
i'm trying use dropbox datastore api nodejs. can connect , use fine, can't seem stop , let program exit gracefully. pulled file https://www.dropbox.com/static/api/1/dropbox-datastores-0.1.0-b3.js , put in local directory.
so if run following (with valid creds) never exits.
var dropbox = new require('./dropbox.js') var client = new dropbox.client ({ key:'apikey', secret:'apisecret', token:'useroauthtoken', uid:'useruid' }); var datastoremanager = client.getdatastoremanager(); datastoremanager.opendefaultdatastore(function(error,datastore){ if(error) console.log(error); var table = datastore.gettable('exampletable'); table.insert({hello:'newman',inthepool:true}); });
have tried process.exit() (see http://nodejs.org/api/process.html#process_process_exit_code)?
this should shutdown program gracefully.
Comments
Post a Comment