
put.io-node
A Node.js wrapper for put.io APIv2 https://api.put.io/v2/docs/
It supports all the methods & functions that put.io's API provides: Files, Transfers, Zips, Friends, Account, Events.
Take a look at put.io's API documentation to get started.
Install
Via NPM
$ npm install put.io-node
Via GIT
$ git clone git@github.com:alormil/put.io-node.git
Usage
const Client = require('put.io-node').Client;
const apiClient = new Client('XYZTOKEN');
apiClient.account.getAccountInfo().then((result) => console.log(JSON.parse(result)));
apiClient.friends.sendFriendRequest('Bob').then((result) => console.log(JSON.parse(result)));
apiClient.zips.createZip([123,556,989]).then((result) => console.log(JSON.parse(result)));
apiClient.transfers.getTransfersList().then((result) => console.log(JSON.parse(result)));
apiClient.files.createFolder('Folder123', 0).then((result) => console.log(JSON.parse(result)));
apiClient.events.getEventsList().then((result) => console.log(JSON.parse(result)));
All functions return string promises, make sure you convert these strings to JSON objects for future manipulation.
I will add examples for each function call in the Wiki, but feel free to have a look at the source code in order to see which functions are available.
Tests
$ npm test
Security
If you discover any security related issues, please email me at: alormil@gmail.com.
Contributing
Pull requests are welcome, take care of maintaining the existing coding style. Add unit tests for any new or changed functionality.
Lint and test your code using the existing standards.
License
MIT License
Copyright (c) 2016 Alain Lormil
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.