1.6.0 • Published 10 years ago

couchmagick-listen v1.6.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

couchmagick-listen

Stream changes to couchmagick-stream.

Usage

Create a design document with a couchmagick configuration:

{
  "_id": "_design/my-couchmagick-config",
  "_rev": "1-a653b27246b01cf9204fa9f5dee7cc64",
  "couchmagick": {
    "filter": "function(doc) { return doc.type === 'post'; }",
    "versions": {
      "thumbnail": {
        "filter": "function(doc, name) { return doc.display && doc.display.indexOf('overview') > -1; }",
        "id": "{id}/thumbnail",
        "name": "{basename}-thumbnail.jpg",
        "content_type": "image/jpeg",
        "args": [
          "-",
          "-resize", "x100",
          "-quality", "75",
          "-colorspace", "sRGB",
          "-strip",
          "jpg:-"
        ]
      }
    }
  }
}

See couchmagick-stream for available options;

Listen for changes:

require('couchmagick-listen')('http://localhost:5984/mydb')
  .on('data', function(resp) {
    console.log('Image resized: ', resp);
  });

Configuration

couchmagick-listen accepts an options object as second parameter, which accepts the following parameters:

  • concurrency - Number of simultanous processes
  • convert_process_timeout - Timeout for convert process
  • feed - format of the changes feed
  • limit - limit for changes feed
  • changes_feed_timeout - timeout for changes feed

Examples

You can run an example (examples/simple.js):

node examples/simple.js http://localhost:5984/mydb

Contributing

Lint your code with npm run jshint

(c) 2013 Johannes J. Schmidt, null2 GmbH

1.6.0

10 years ago

1.5.6

10 years ago

1.5.5

10 years ago

1.5.4

10 years ago

1.5.3

10 years ago

1.5.2

10 years ago

1.5.1

10 years ago

1.5.0

10 years ago

1.4.3

10 years ago

1.4.2

10 years ago

1.4.1

10 years ago

1.4.0

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago