{"_id":"top.js","_rev":"41-70f4ab583331a69d6cdf135cb81484d3","name":"top.js","description":"Taobao Open Platform API","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.1":{"name":"top.js","version":"0.0.1","main":"index.js","dependencies":{"request":""},"engines":{"node":">= 0.8.x","npm":">= 1.1.x"},"scripts":{"test":"mocha -R spec -t 300000"},"_id":"top.js@0.0.1","description":"ERROR: No README.md file found!","dist":{"shasum":"d574339fcb853cef0f5395391fbb7bc51a9f0f4b","tarball":"https://registry.npmjs.org/top.js/-/top.js-0.0.1.tgz","integrity":"sha512-QRAKqTi4SXVKoi6N3GC0/4W89MWmc0ZAHtCgZeTFrw4sCnztqAJBuUevWDiiVan0tsSYLXaODZ59NTlxDRwbHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8cqNBK57guMwrA18y2/wi54O/OP+yzcbLu8RbWPIB1QIgbyob5sVh3W8z5ecukkJtCi1tmTLGbciXT5FVy7WIMV8="}]},"_npmVersion":"1.1.61","_npmUser":{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"},"maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}],"directories":{}},"0.0.2":{"name":"top.js","version":"0.0.2","main":"index.js","dependencies":{"request":""},"engines":{"node":">= 0.8.x","npm":">= 1.1.x"},"scripts":{"test":"mocha -R spec -t 300000"},"_id":"top.js@0.0.2","description":"ERROR: No README.md file found!","dist":{"shasum":"726b123850ca86709f58320dac539f974eeb4d78","tarball":"https://registry.npmjs.org/top.js/-/top.js-0.0.2.tgz","integrity":"sha512-UT47WPD+N910Fiw2AJ4uea3eTuZ5UeDZ2wPVnIcPWVeBabeKLL1qg8wuPIpJzJej/JjIlFTtlXvKGJAe/QRw0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAc81MC7E4iMn0TjI7lqm3yql14Xm/YOCGSNS7t5Vq7wIgJw3Adtgi7qS2tutbtHNfKtlcvkHf70thAi6eKCGN6Qw="}]},"_npmVersion":"1.1.61","_npmUser":{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"},"maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}],"directories":{}},"0.0.3":{"name":"top.js","description":"Taobao Open Platform API","author":{"name":"Frank Xu","email":"yyfrankyy@gmail.com"},"keywords":["top","taobao","api"],"version":"0.0.3","main":"index","dependencies":{"request":""},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/yyfrankyy/top.js"},"scripts":{"test":"./node_modules/.bin/mocha -R spec -t 300000"},"_id":"top.js@0.0.3","dist":{"shasum":"03df2933f480088db669efbbe5812ff4e03c029b","tarball":"https://registry.npmjs.org/top.js/-/top.js-0.0.3.tgz","integrity":"sha512-aNvUzRZx89iVgx5wS6LeZrRMmoRifbulkC1V8SZKKB/VSj9TfXaQwwZ4/8qLhv+11CXXJ2G6VoYb0N6u2p6p3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARvBvZLiXtjxtCdaCsRJDa6kACupBLN1QBCfxU2S39/AiBIgfBCZCZ3yJqUWzOzr60O2jCm07iUW/7VxHQT8sBY7w=="}]},"_npmVersion":"1.1.61","_npmUser":{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"},"maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}],"directories":{}},"0.0.5":{"name":"top.js","description":"Taobao Open Platform API","author":{"name":"Frank Xu","email":"yyfrankyy@gmail.com"},"keywords":["top","taobao","api"],"version":"0.0.5","main":"index","bin":{"top-cli":"./top-cli"},"dependencies":{"request":"","optimist":"","eyes":""},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/yyfrankyy/top.js"},"scripts":{"test":"./node_modules/.bin/mocha -R spec -t 300000"},"_id":"top.js@0.0.5","dist":{"shasum":"c6925cab67ddecb061076213c86e87fc1a6d1889","tarball":"https://registry.npmjs.org/top.js/-/top.js-0.0.5.tgz","integrity":"sha512-slgZUGCqRfb/REavRXrIGyetdaDMjyR6Q7mTKQqBBbnCLDEu2rcr6iK56fXNM+1OUO1aQqVNiVok+PeMYXJFVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvmO4dAvB3MMbUMT5o6IkBqN2ikcTGBIV+FkOnoiU6IAIhAJ87/4zZcIOfk1LMaGVRPXWvqCekaplOpiUu9CVE+Tds"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"},"maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}],"directories":{}},"0.0.6":{"name":"top.js","description":"Taobao Open Platform API","author":{"name":"Frank Xu","email":"yyfrankyy@gmail.com"},"keywords":["top","taobao","api"],"version":"0.0.6","main":"index","bin":{"top-cli":"./top-cli"},"dependencies":{"request":"","optimist":"","eyes":""},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/yyfrankyy/top.js"},"scripts":{"test":"./node_modules/.bin/mocha -R spec -t 300000"},"_id":"top.js@0.0.6","dist":{"shasum":"85f67693924826de30cf1af6d5baeeb31986f7cb","tarball":"https://registry.npmjs.org/top.js/-/top.js-0.0.6.tgz","integrity":"sha512-4lWZxHMdcnTr47QQ6GyvPiGBDWz2Rjkdl4z0ZLlibqWJsNN7roDDOf8Jy/wxR3/KOgO/b6nel5nu6tUaTVUu3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8NIkxyuZWESrOXT21+I/xIq00LAJOBrohzfF06SQPKgIgNqUxhivFBtKcgPWnDlQ8HJCXJNhgM/dgCUFlYccqq04="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"},"maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}],"directories":{}},"0.0.7":{"name":"top.js","description":"Taobao Open Platform API","author":{"name":"Frank Xu","email":"yyfrankyy@gmail.com"},"keywords":["top","taobao","api"],"version":"0.0.7","main":"index","bin":{"top-cli":"./top-cli"},"dependencies":{"request":"","optimist":"","eyes":""},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/yyfrankyy/top.js"},"scripts":{"test":"./node_modules/.bin/mocha -R spec -t 300000"},"_id":"top.js@0.0.7","dist":{"shasum":"37d1e575b113ccf73803d89a0d59936d453a837b","tarball":"https://registry.npmjs.org/top.js/-/top.js-0.0.7.tgz","integrity":"sha512-kZfHy5WniSZDShTfAqJLaR3Wosp8u4JpGKCzSpZn5sUXzR0/7B55jCpTxYzPSAFQq18ms0MR6CsRgrcVMIuQsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDY3oMrNMe7BQF/XA4H0i1IEx+aOVT4T7et6tCVWGH0rAiEA2VcDm2YsI5z75dOHzSmumCmxzQY1bBfsy2gQA/TPwdE="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"},"maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}],"directories":{}},"0.0.8":{"name":"top.js","description":"Taobao Open Platform API","author":{"name":"Frank Xu","email":"yyfrankyy@gmail.com"},"keywords":["top","taobao","api"],"version":"0.0.8","main":"index","bin":{"top-cli":"./top-cli"},"dependencies":{"request":"","optimist":"","eyes":""},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/yyfrankyy/top.js"},"scripts":{"test":"./node_modules/.bin/mocha -R spec -t 300000"},"bugs":{"url":"https://github.com/yyfrankyy/top.js/issues"},"homepage":"https://github.com/yyfrankyy/top.js","_id":"top.js@0.0.8","dist":{"shasum":"f2b8f64184d7597ed01fdd0ae250a5de5c148a06","tarball":"https://registry.npmjs.org/top.js/-/top.js-0.0.8.tgz","integrity":"sha512-8QB6fdoMjlPjmSawwFRdRQnFl2u2IIExcQVKMTwoXe/r7gy0FwOYtN1LP0RsystU728LM8QWcxKoxFO9U8FoBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGgIRCKuKV0UJFuv2KvxDe8EPn7dCsAivclUWp00merwAiBCOPjCKTbmlNVoobH2mXK+NNWpZ6iIcawPRc7EuEyVNw=="}]},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"},"maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}]}},"readme":"# top.js\n\n[![Build Status](https://secure.travis-ci.org/yyfrankyy/top.js.png)](http://travis-ci.org/yyfrankyy/top.js)\n\nTaobao Open Platform API for node.js.\n\n## Use as a library\n\n### Install\n\n```bash\nnpm install top.js\n```\n\n### Usage\n\n```javascript\nvar topClient = require('top.js').createClient({\n    app_key: 'Your Key'\n  , app_secret: 'Your Secret'\n  , debug: true\n})\n\ntopClient.query('taobao.item.get', {\n    fields: 'num_iid'\n  , num_iid: 16289288120\n}, function(err, o) {\n  if (err) console.error(err)\n  else console.log(o)\n})\n```\n\n#### Use `Proxy` (nodejs >= 0.11 with `node --harmony`)\n\n```javascript\ntopClient.proxy().taobao().item().get({\n    fields: 'num_iid'\n  , num_iid: 16289288120\n}).done(function(err, o) {\n  if (err) console.error(err)\n  else console.log(o)\n})\n```\n\n### A cache middleware for connect / express\n\n```javascript\nvar redis = require('redis').createClient()\nvar app = require('express')()\n\napp.use(require('top.js').createClient({\n    app_key: 'Your Key'\n  , app_secret: 'Your Secret'\n}).express({\n    get: function(hash, cb) {\n      redis.get(hash, cb)\n    }\n  , set: function(hash, data, cb) {\n      redis.multi().set(hash, data).expire(hash, 3600 * 24).exec(cb)\n    }\n}))\n\napp.get('/item/:id', funtion(req, res) {\n  res.top('taobao.taobaoke.items.detail.get', {\n      fields: 'click_url'\n    , num_iids: req.params.id\n  }, function(err, data) {\n    if (err) return res.send(500, err.toString())\n    res.send(data)\n  })\n})\n```\n\n## Use as a command-line tool\n\n### Install\n\n```bash\n$ npm install top.js -g\n```\n\n### Usage\n\n*Put `TOP_APP_KEY` and `TOP_APP_SECRET` in your environment variables*\n\n```bash\nexport TOP_APP_KEY={your key}\nexport TOP_APP_SECRET={your secret}\n```\n\nFirst try\n\n```bash\n$ top-cli --api taobao.item.get --fields cid --num_iid=19731060339\n{\n    item: { cid: 50006846 }\n}\n```\n\nEven for array like arguments\n\n```bash\n$ top-cli --api taobao.item.get --fields cid --fields num_iid --num_iid=19731060339\n{\n    item: { cid: 50006846, num_iid: 19731060339 }\n}\n```\n\nIf you need plain json data for piping purpose or something, use `--plain`\n\n```bash\n$ top-cli --plain --api taobao.item.get --fields cid --fields num_iid --num_iid=19731060339\n{\"item\":{\"cid\":50006846,\"num_iid\":19731060339}}\n```\n\n## LICENSE\n\n```\nCopyright (c) 2012-2013 Frank Xu\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n","maintainers":[{"name":"yyfrankyy","email":"yyfrankyy@gmail.com"}],"time":{"modified":"2022-06-27T18:34:22.553Z","created":"2012-10-17T07:09:05.026Z","0.0.1":"2012-10-17T07:09:11.128Z","0.0.2":"2012-10-17T09:10:34.464Z","0.0.3":"2012-10-23T08:14:14.244Z","0.0.5":"2012-11-26T05:07:17.925Z","0.0.6":"2013-01-11T08:28:37.797Z","0.0.7":"2013-04-05T04:46:13.586Z","0.0.8":"2014-01-16T06:58:04.956Z"},"author":{"name":"Frank Xu","email":"yyfrankyy@gmail.com"},"repository":{"type":"git","url":"git://github.com/yyfrankyy/top.js"},"readmeFilename":"README.md"}