Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Commit a5428aa

Browse files
committed
Updated README.md
1 parent bab21a3 commit a5428aa

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
[![NPM](https://nodei.co/npm/getstream-node.png)](https://nodei.co/npm/getstream-node/)
88

9-
[stream-node-orm](https://github.com/GetStream/stream-node-orm) is a Node.js (Sails, Waterline) client for [Stream](https://getstream.io/).
9+
[stream-node-orm](https://github.com/GetStream/stream-node-orm) is a Node.js (Mongoose & Waterline) client for [Stream](https://getstream.io/).
1010

1111
You can sign up for a Stream account at https://getstream.io/get_started.
1212

1313
Note there is also a lower level [Node.js - Stream integration](https://github.com/getstream/stream-js) library which is suitable for all JavaScript applications.
1414

15-
### Build activity streams & news feeds
15+
### Build Activity Streams & News Feeds
1616

1717
<p align="center">
1818
<img src="https://dvqg2dogggmn6.cloudfront.net/images/mood-home.png" alt="Examples of what you can build" title="What you can build"/>
@@ -37,7 +37,7 @@ Stream node currently supports:
3737

3838
You can check out our example app on Github [https://github.com/GetStream/Stream-Example-Nodejs](https://github.com/GetStream/Stream-Example-Nodejs)
3939

40-
###Installation
40+
### Installation
4141

4242
#### Step 1 - NPM
4343

@@ -75,7 +75,7 @@ stream.mongoose.setupMongoose(mongoose);
7575

7676
Every time a Tweet is created it will be added to the user's feed. Users which follow the given user will also automatically get the new tweet in their feeds.
7777

78-
####Activity fields
78+
#### Activity Fields
7979

8080
Models are stored in feeds as activities. An activity is composed of at least the following fields: **actor**, **verb**, **object**, **time**. You can also add more custom data if needed.
8181
The Activity mixin will try to set things up automatically:
@@ -101,7 +101,7 @@ tweetSchema.methods.activityActorProp = function() {
101101
}
102102
```
103103

104-
#### Customizing the activity
104+
#### Customizing the Activity
105105

106106
Sometimes you'll want full control over the activity that's send to getstream.io.
107107
To do that you can overwrite the default createActivity method on the model
@@ -126,22 +126,22 @@ tweetSchema.methods.createActivity = function() {
126126
}
127127
```
128128

129-
###Feed manager
129+
### Feed Manager
130130

131131
This packages comes with a feed_manager class that helps with all common feed operations.
132132

133-
####Feeds bundled with feed_manager
133+
#### Feeds Bundled with feed_manager
134134

135135
To get you started the manager has 4 feeds pre-configured. You can add more feeds if your application needs it.
136136
The three feeds are divided in three categories.
137137

138-
#####User feed:
138+
##### User Feed:
139139
The user feed stores all activities for a user. Think of it as your personal Facebook page. You can easily get this feed from the manager.
140140
```js
141141
FeedManager.getUserFeed(req.user.id);
142142
```
143143

144-
#####News feeds:
144+
##### News Feeds:
145145
The news feeds store the activities from the people you follow.
146146
There is both a flat newsfeed (similar to twitter) and an aggregated newsfeed (like facebook).
147147

@@ -150,7 +150,7 @@ var flatFeed = FeedManager.getNewsFeeds(foundUser._id)['timeline_flat'];
150150
var aggregatedFeed = FeedManager.getNewsFeeds(req.user.id)['timeline_aggregated'];
151151
```
152152

153-
#####Notification feed:
153+
##### Notification Feed:
154154
The notification feed can be used to build notification functionality.
155155

156156
<p align="center">
@@ -181,16 +181,16 @@ followSchema.methods.activityNotify = function() {
181181
};
182182
```
183183

184-
####Follow a feed
184+
#### Follow a Feed
185185
To follow the created newsfeeds you need to notify the system about follow relationships. The manager comes with APIs to let a user's news feeds follow another user's feed. This code lets the current user's flat and aggregated feeds follow the target_user's personal feed.
186186

187187
```
188188
FeedManager.followUser(userId, targetId);
189189
```
190190

191-
### Showing the newsfeed
191+
### Showing the Newsfeed
192192

193-
####Activity enrichment
193+
#### Activity Enrichment
194194

195195
When you read data from feeds, a like activity will look like this:
196196

@@ -219,15 +219,15 @@ router.get('/flat', ensureAuthenticated, function(req, res, next){
219219

220220
Promises are used to pipe the asynchronous result of `flatFeed.get` and `StreamBackend.enrichActivities` through our code.
221221

222-
###Temporarily disabling the model sync
222+
### Temporarily Disabling the Model Sync
223223

224224
Model synchronization can be disabled manually via environment variable.
225225

226226
```js
227227
NODE_ENV=test npm test
228228
```
229229

230-
####Automatically populate paths:
230+
#### Automatically Populate Paths:
231231

232232
You can automatically populate paths during enrichment via the pathsToPopulate static.
233233

@@ -237,7 +237,7 @@ tweetSchema.statics.pathsToPopulate = function() {
237237
};
238238
```
239239

240-
### Full documentation and Low level APIs access
240+
### Full Documentation and Low Level APIs Access
241241

242242
When needed you can also use the [low level JavaScript API](https://github.com/getstream/stream-js) directly. Documentation is available at the [Stream website](https://getstream.io/docs/?language=js).
243243

@@ -265,9 +265,9 @@ streamWaterline.enrichActivities(activities).then(function(enrichedActivities) {
265265
})
266266
```
267267

268-
### Customizing enrichment (since 1.4.0)
268+
### Customizing Enrichment (since 1.4.0)
269269

270-
By default the enrichment system assumes that you're referencing items by their id. Sometimes you'll want to customize this behaviour. You might for instance use a username instead of an id. Alternatively you might mant to use a caching layer instead of the ORM for loading the data. The example below shows how to customize the lookup for all User entries.
270+
By default the enrichment system assumes that you're referencing items by their id. Sometimes you'll want to customize this behavior. You might for instance use a username instead of an id. Alternatively you might mant to use a caching layer instead of the ORM for loading the data. The example below shows how to customize the lookup for all User entries.
271271

272272
```js
273273
// subclass streamMongoose
@@ -312,7 +312,14 @@ npm install
312312
npm version [ major | minor | patch ]
313313
npm publish
314314
```
315-
=======
315+
316+
### Supported Node.js Versions
317+
```
318+
v8.x
319+
v7.x
320+
v6.x
321+
```
322+
316323
### Copyright and License Information
317324

318325
Copyright (c) 2015-2017 Stream.io Inc, and individual contributors. All rights reserved.

0 commit comments

Comments
 (0)