@google-cloud/datastore
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -7,2 +7,12 @@ # Changelog | ||
## v3.0.1 | ||
01-15-2019 13:20 PST | ||
### Bug fixes | ||
- fix: ship the build directory ([#300](https://github.com/googleapis/nodejs-datastore/pull/300)) | ||
### Internal / Testing Changes | ||
- build: check broken links in generated docs ([#292](https://github.com/googleapis/nodejs-datastore/pull/292)) | ||
## v3.0.0 | ||
@@ -9,0 +19,0 @@ |
{ | ||
"name": "@google-cloud/datastore", | ||
"description": "Cloud Datastore Client Library for Node.js", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"license": "Apache-2.0", | ||
@@ -13,7 +13,4 @@ "author": "Google Inc.", | ||
"files": [ | ||
"protos", | ||
"src", | ||
"AUTHORS", | ||
"CONTRIBUTORS", | ||
"LICENSE" | ||
"build/protos", | ||
"build/src" | ||
], | ||
@@ -76,3 +73,3 @@ "keywords": [ | ||
"gts": "^0.9.0", | ||
"ink-docstrap": "^1.3.2", | ||
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", | ||
"intelli-espower-loader": "^1.0.1", | ||
@@ -79,0 +76,0 @@ "jsdoc": "^3.5.5", |
115
README.md
@@ -11,22 +11,6 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
> Node.js idiomatic client for [Cloud Datastore][product-docs]. | ||
[Cloud Datastore](https://cloud.google.com/datastore/docs) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. While the Cloud Datastore interface has many of the same features as traditional databases, as a NoSQL database it differs from them in the way it describes relationships between data objects. | ||
* [Cloud Datastore Node.js Client API Reference][client-docs] | ||
* [github.com/googleapis/nodejs-datastore](https://github.com/googleapis/nodejs-datastore) | ||
* [Cloud Datastore Documentation][product-docs] | ||
Read more about the client libraries for Cloud APIs, including the older | ||
Google APIs Client Libraries, in [Client Libraries Explained][explained]. | ||
[explained]: https://cloud.google.com/apis/docs/client-libraries-explained | ||
**Table of contents:** | ||
* [Quickstart](#quickstart) | ||
* [Before you begin](#before-you-begin) | ||
* [Installing the client library](#installing-the-client-library) | ||
* [Using the client library](#using-the-client-library) | ||
* [Using the client library](#using-the-client-library) | ||
* [Samples](#samples) | ||
@@ -37,32 +21,19 @@ * [Versioning](#versioning) | ||
## Quickstart | ||
## Using the client library | ||
### Before you begin | ||
1. [Select or create a Cloud Platform project][projects]. | ||
1. Select or create a Cloud Platform project. | ||
1. [Enable billing for your project][billing]. | ||
[Go to the projects page][projects] | ||
1. [Enable the Google Cloud Datastore API][enable_api]. | ||
1. Enable billing for your project. | ||
[Enable billing][billing] | ||
1. Enable the Google Cloud Datastore API. | ||
[Enable the API][enable_api] | ||
1. [Set up authentication with a service account][auth] so you can access the | ||
API from your local workstation. | ||
[projects]: https://console.cloud.google.com/project | ||
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing | ||
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=datastore.googleapis.com | ||
[auth]: https://cloud.google.com/docs/authentication/getting-started | ||
1. Install the client library: | ||
### Installing the client library | ||
npm install --save @google-cloud/datastore | ||
npm install --save @google-cloud/datastore | ||
1. Try an example: | ||
### Using the client library | ||
```javascript | ||
@@ -72,34 +43,31 @@ // Imports the Google Cloud client library | ||
// Your Google Cloud Platform project ID | ||
const projectId = 'YOUR_PROJECT_ID'; | ||
async function quickStart() { | ||
// Your Google Cloud Platform project ID | ||
const projectId = 'YOUR_PROJECT_ID'; | ||
// Creates a client | ||
const datastore = new Datastore({ | ||
projectId: projectId, | ||
}); | ||
// Creates a client | ||
const datastore = new Datastore({ | ||
projectId: projectId, | ||
}); | ||
// The kind for the new entity | ||
const kind = 'Task'; | ||
// The name/ID for the new entity | ||
const name = 'sampletask1'; | ||
// The Cloud Datastore key for the new entity | ||
const taskKey = datastore.key([kind, name]); | ||
// The kind for the new entity | ||
const kind = 'Task'; | ||
// The name/ID for the new entity | ||
const name = 'sampletask1'; | ||
// The Cloud Datastore key for the new entity | ||
const taskKey = datastore.key([kind, name]); | ||
// Prepares the new entity | ||
const task = { | ||
key: taskKey, | ||
data: { | ||
description: 'Buy milk', | ||
}, | ||
}; | ||
// Prepares the new entity | ||
const task = { | ||
key: taskKey, | ||
data: { | ||
description: 'Buy milk', | ||
}, | ||
}; | ||
// Saves the entity | ||
datastore | ||
.save(task) | ||
.then(() => { | ||
console.log(`Saved ${task.key.name}: ${task.data.description}`); | ||
}) | ||
.catch(err => { | ||
console.error('ERROR:', err); | ||
}); | ||
// Saves the entity | ||
await datastore.save(task); | ||
console.log(`Saved ${task.key.name}: ${task.data.description}`); | ||
} | ||
quickStart().catch(console.error); | ||
``` | ||
@@ -116,3 +84,2 @@ | ||
| Concepts | [source code](https://github.com/googleapis/nodejs-datastore/blob/master/samples/concepts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/concepts.js,samples/README.md) | | ||
| Errors and Error Handling | [source code](https://github.com/googleapis/nodejs-datastore/blob/master/samples/error.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/error.js,samples/README.md) | | ||
@@ -146,5 +113,19 @@ The [Cloud Datastore Node.js Client API Reference][client-docs] documentation | ||
## What's Next | ||
* [Cloud Datastore Documentation][product-docs] | ||
* [Cloud Datastore Node.js Client API Reference][client-docs] | ||
* [github.com/googleapis/nodejs-datastore](https://github.com/googleapis/nodejs-datastore) | ||
Read more about the client libraries for Cloud APIs, including the older | ||
Google APIs Client Libraries, in [Client Libraries Explained][explained]. | ||
[explained]: https://cloud.google.com/apis/docs/client-libraries-explained | ||
[client-docs]: https://cloud.google.com/nodejs/docs/reference/datastore/latest/ | ||
[product-docs]: https://cloud.google.com/datastore/docs | ||
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png | ||
[projects]: https://console.cloud.google.com/project | ||
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing | ||
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=datastore.googleapis.com | ||
[auth]: https://cloud.google.com/docs/authentication/getting-started |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
364047
29
7683
127
4