npm install amazon-driveSimple rest client based on the cloud drive API:
https://developer.amazon.com/public/apis/experience/cloud-drive/content/restful-api-getting-started
This is a Promise based API.

acceess_token and a refresh_token-- which allows us to renew the credentials programmatically.request('./auth.json'). This file contains the auth object return from ajs
{
"access_token": "Atza|",
"refresh_token": "Atzr|",
"token_type": "bearer",
"expires_in": 3600
}
`The basics
The javascript API matches the REST API the best it can.
`js
let urlsCache
const drive = require('amazon-drive')({
cacheUrls: (urls) => {
// urls passed in: save them
if (urls) urlsCache = urls
return Promise.resolve(urlsCache)
},
refresh: () => {
// When this OAuth token expires (401 returned) this will be called.
// You will need to refresh the token and return an updated auth object.
// See: examples/refresh.js
}
})// get the urls for your account and cache them
drive.getUrls()
.then((urls) => {
console.log(urls.metadataUrl)
console.log(urls.contentUrl)
})
.catch(console.error)
`API
$3
#### drive.getUrls()
All endpoints will call this internally to retrieve the account's endpoints. If they are retrieved
from the Amazon Drive API, it will call cacheUrls(urls) for you to cache them somewhere. Amazon
requests that they be cached for 3 to 5 days.#### drive.account.endpoint()
This is what
drive.getUrls()` calls- but without caching.#### drive.account.info()
#### drive.account.quota()
#### drive.account.usage()
#### drive.nodes.create(name, metadata = {})
Creates a folder
#### drive.nodes.get(id, options = undefined)
#### drive.nodes.patch(id, properties)
#### drive.nodes.list(options)
#### drive.nodes.list.all(filters = undefined)
#### drive.nodes.children.add(parent, child)
#### drive.nodes.children.move(child, oldParent, newParent)
#### drive.nodes.children.delete(parent, child)
#### drive.nodes.children.list(parent, options = undefined)
#### drive.nodes.properties.add(id, owner, key, value)
#### drive.nodes.properties.get(id, owner, key)
#### drive.nodes.properties.delete(id, owner, key)
#### drive.nodes.properties.list(id, owner)
See:
* https://github.com/alex-phillips/node-clouddrive
* https://github.com/alex-phillips/node-clouddrive/issues/9
* https://github.com/alex-phillips/clouddrive-endpoint