mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
51 lines
8.6 KiB
JSON
51 lines
8.6 KiB
JSON
![]() |
{
|
||
|
"name": "googleapis",
|
||
|
"version": "0.2.13-alpha",
|
||
|
"author": {
|
||
|
"name": "Google Inc."
|
||
|
},
|
||
|
"description": "Google APIs Client Library for Node.js",
|
||
|
"contributors": [
|
||
|
{
|
||
|
"name": "Burcu Dogan",
|
||
|
"email": "jbd@google.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "Monsur Hossain",
|
||
|
"email": "monsur@google.com"
|
||
|
}
|
||
|
],
|
||
|
"main": "./lib/googleapis",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "https://github.com/google/google-api-nodejs-client.git"
|
||
|
},
|
||
|
"keywords": [
|
||
|
"google",
|
||
|
"api",
|
||
|
"google apis",
|
||
|
"client",
|
||
|
"client library"
|
||
|
],
|
||
|
"dependencies": {
|
||
|
"request": "2.14.0",
|
||
|
"async": "0.2.6"
|
||
|
},
|
||
|
"devDependencies": {
|
||
|
"mocha": "1.8.1",
|
||
|
"url": "0.7.9"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"test": "mocha tests/* --reporter spec --timeout 40000"
|
||
|
},
|
||
|
"license": "Apache 2",
|
||
|
"readme": "# google-api-nodejs-client [alpha]\n\n[](https://travis-ci.org/google/google-api-nodejs-client)\n\n`google-api-nodejs-client` is Google's officially supported\n[node.js](http://nodejs.org/) client\nlibrary for accessing Google APIs, it also supports authorization and\nauthentication with OAuth 2.0.\n\n**Note**: This library is currently in *alpha* status, meaning that we can make\nchanges in the future that *may not be compatible* with the previous versions.\n\n## Installation\n\nThe library is distributed on `npm`. In order to add it as a dependency,\nrun the following command:\n\n $ npm install googleapis\n\n## Guide\n\n### Discover APIs\n\nDynamically load Google APIs and start making requests:\n\n~~~~ js\nvar googleapis = require('googleapis');\n\ngoogleapis\n .discover('urlshortener', 'v1')\n .discover('plus', 'v1')\n .execute(function(err, client) {\n var params = { shortUrl: 'http://goo.gl/DdUKX' };\n var req1 = client.urlshortener.url.get(params);\n req1.execute(function (err, response) {\n console.log('Long url is', response.longUrl);\n });\n\n var req2 = client.plus.people.get({ userId: '+BurcuDogan' });\n req2.execute();\n});\n~~~~\n\nSupported APIs are listed on\n[Google APIs Explorer](https://developers.google.com/apis-explorer).\n\n#### Discovery Document Caching\n\nDiscovery documents are being cached for 5 minutes locally.\nYou can configure the directory used to store cached discovery\nfiles by using the `cache.path` option.\n\n~~~~ js\ngoogleapis\n .discover('plus', 'v3')\n .withOpts({ cache: { path: '<path>' }))\n .execute();\n~~~~\n\n### API Client\n\nClient libraries are generated during runtime by metadata provided by Google\nAPIs Discovery Service. Metadata provided by Discovery Service is cached,\nand won't be requested each time you load a client. Below, there is an\nexample of loading a client for\n[URL Shortener API](https://developers.google.com/url-shortener/).\n\n~~~~ js\ngoogleapis\n .discover('urlshortener', 'v1')\n .execute(function(err, client) {\n // make requests\n });\n~~~~\n\n### Requests\n\nThe following sample loads a client for URL Shortener and retrieves the long url\nof the given short url:\n\n~~~~ js\ngoogleapis.discover('urlshortener', 'v1').execute(function(err, client) {\n client.urlshortener.url.get({ shortUrl: 'http://goo.gl/DdUKX' })\n .execute(function(err, result) {\n // result.longUrl contains the long url.\n });\n });\n~~~~\n\nAlternatively, you may need to send an API key with the\nrequest you are going to make. The following creates and executes a request from the Google+ API service to retrieve a person profile given a userId:\n\n~~~~ js\ngoogleapis\n .discover('plus', 'v1')\n .execute(function(err, client) {\n var request1 = client.plus.people.get({ userId: '+BurcuDogan' })\n .withApiKey(API_KEY);\n\n request1.execute(function(err, result) {\n console.log(\"Result: \" + (err ? err.message : result.displayName));\n });\n });\n~~~~\n\nTo learn more about API keys, please see the [documentation](https://developers.google.com/console/help/#UsingKeys).\n\n### Batch requests\n\nYou can combine multiple requests in a single one by using batch requests.\n\n~~~~ js\nvar request1 =\n client.plus.people.get({ userId: '+BurcuDogan' });\n\nvar request2 =\n client.urlshortener.url.insert({ longUrl: 'http://google.com' });\n\n// Create from client service using the raw action name\nvar request3 = client.urlshortener.newRequest(\n 'urlshortener.url.get', { shortUrl: 'http://goo.gl/DdUKX' });\n\nclient\n .newBatchRequest()\n .add(request1)\n .add(request2)\n .add(request3)\n .execute(function(err, results) {\n\n });\n~~~~\n\n### Authorization and Authentication\n\nThis client comes with an OAuth2 client that allows you to retrieve an access token and\nrefreshes the token and re-try the request seamlessly if token is expired. The\nbasics of Google's OAuth 2.0 implementation is explained on\n[Google
|
||
|
"readmeFilename": "README.md",
|
||
|
"_id": "googleapis@0.2.13-alpha",
|
||
|
"dist": {
|
||
|
"shasum": "8f226e77499d78225edf42fd1e0b3b7cb06259f3"
|
||
|
},
|
||
|
"_from": "googleapis@",
|
||
|
"_resolved": "https://registry.npmjs.org/googleapis/-/googleapis-0.2.13-alpha.tgz"
|
||
|
}
|