Skip to content

Commit

Permalink
General repo improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Jan 9, 2017
1 parent ecef316 commit 0063e9e
Show file tree
Hide file tree
Showing 11 changed files with 2,342 additions and 54 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
doc/
coverage/
.nyc_output/
8 changes: 8 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is the official list of cloud-functions-emulator project authors.
#
# Names are formatted as:
# Name or Organization [email address]
#
# The email address is not required for organizations.
#
Google Inc.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
##### 1.0.0-alpha.1 - 09 January 2017
##### 1.0.0 - 09 January 2017

###### Breaking changes

- Changed dependency on `gcloud` to ` peer dependency on `@google-cloud/datastore`
- Rename package to `@google-cloud/connect-datastore`

###### Other

- Update code style and switch to using Semistandard for linting
- Added `yarn.lock` file
- Updated licensing, authors, contributors, readme
7 changes: 7 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is the official list of cloud-functions-emulator project contributors.
#
# Names are formatted as:
# Name [email address]
#
Jason Dobry <[email protected]>
Jon Wayne Parrott <[email protected]>
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Inc. logo" title="Google" align="right" height="96" width="96"/>

# Google Cloud Datastore Sessions

**@google-cloud/connect-datastore** is a [Google Cloud Datastore][datastore]
session store backed by [@google-cloud/datastore][datastore_lib].

**Note:** Cloud Datastore is a persistent, distributed, transactional database.
Often, it's more appropriate to choose a different storage solution for sessions
such as Memcache or Redis as their designs offer much faster operation in this
use case.

## Installation

npm install --save @google-cloud/connect-datastore

or

yarn add @google-cloud/connect-datastore

## Configuration

You must have a Google Cloud project and credentials.

See [gcloud node's documentation][auth] on setting up authentication.

## Usage Example

```javascript
var Datastore = require('@google-cloud/datastore');

var express = require('express');
var session = require('express-session');
var app = express();

var DatastoreStore = require('@google-cloud/connect-datastore')(session);

app.use(session({
store: new DatastoreStore({
dataset: Datastore({
prefix: 'express-sessions',

// For convenience, @google-cloud/datastore automatically looks for the
// GCLOUD_PROJECT environment variable. Or you can explicitly pass in a
// project ID here:
projectId: 'YOUR_PROJECT_ID' || process.env.GCLOUD_PROJECT,

// For convenience, @google-cloud/datastore automatically looks for the
// GOOGLE_APPLICATION_CREDENTIALS environment variable. Or you can
// explicitly pass in that path to your key file here:
keyFilename: '/path/to/keyfile.json' || process.env.GOOGLE_APPLICATION_CREDENTIALS
})
}),
secret: 'my-secret'
}));
```

## Contributing

* See [CONTRIBUTING.md](.github/CONTRIBUTING.md)

## License

* Apache 2.0 - See [LICENSE](LICENSE)

[express]: http://expressjs.com/
[datastore]: https://cloud.google.com/datastore/docs
[datastore_lib]: https://www.npmjs.com/package/@google-cloud/datastore
[auth]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/latest/guides/authentication
29 changes: 19 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
{
"name": "cloud-datastore-session",
"name": "@google-cloud/connect-datastore",
"description": "Google Cloud Datastore session store for Express/Connect",
"version": "0.1.0",
"author": "Jon Wayne Parrott <[email protected]>",
"main": "./index.js",
"version": "1.0.0",
"license": "Apache-2.0",
"author": "Google Inc.",
"main": "./src/index.js",
"engines": {
"node": ">= 0.12.x"
},
"files": [
"AUTHORS",
"CONTRIBUTORS",
"src/"
],
"repository": {
"type": "git",
"url": "https://github.com/GoogleCloudPlatform/cloud-datastore-session-node"
"url": "https://github.com/GoogleCloudPlatform/cloud-datastore-session-node.git"
},
"peerDependencies": {
"@google-cloud/datastore": "^0.6.0"
},
"bugs": {
"url": "https://github.com/GoogleCloudPlatform/cloud-datastore-session-node/issues"
},
"scripts": {
"lint": "semistandard \"**/*.js\""
},
"semistandard": {
"globals": [
"after",
Expand All @@ -32,11 +38,14 @@
"doc"
]
},
"scripts": {
"lint": "semistandard \"**/*.js\""
},
"devDependencies": {
"@google-cloud/datastore": "^0.6.0",
"@google-cloud/datastore": "0.6.0",
"express": "4.14.0",
"express-session": "1.14.2",
"mocha": "3.2.0",
"semistandard": "^9.2.1"
"semistandard": "9.2.1"
}
}
43 changes: 0 additions & 43 deletions readme.md

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0063e9e

Please sign in to comment.