1.1.0 • Published 9 years ago

send-anywhere v1.1.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
9 years ago

A sweet layer on top of Send-Anywhere API to use it with node.js

Installation

npm install send-anywhere

API

Initialize SDK

You can get the API key by requesting it from Send-Anywhere team.

var config = {
	API_KEY  : "XXXXXXXXXXXXXXXXXXXXXXXX" ,
	PROFILE_NAME :  'YYYYYY'	 	
};

var sa = require('./index.js')(config);

sendFile(SRC_FILE , detailsCallback , completedCallback)

sa.sendFile('package.json' , function(err , details){
	console.log(details);
} , function(err , completedObj){
	console.log(completedObj);
});
  • detailsCallback - Use this to fetch the details that are required for receiving the file. check out details object for further information.
  • completedCallback - Use this to execute something after the transfer of file is complete.

receiveAsData(KEY , receivedCallback)

sa.receiveAsData(KEY ,function(err , data , reponse){
  console.log(data);
  console.log(response); //contains headers and other meta data
});

Error Handling

Use the err objects in the callback to handle errors. err has two objects err.error and err.response. In case you would want to dig deep on your errors , a knowledge about this may come handy.

Resources

Contributing

Anything ! More than welcomed.

License

npm.io

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago