# Class: Stream

## Stream

#### new Stream()

A lightweight readable stream implemention that handles event dispatching.

Source:
  - stream.js, line 4

### Methods

#### dispose()

Destroys the stream and cleans up.

Source:
  - stream.js, line 84

#### off(type, listener) → {Boolean}

Remove a listener for a specified event type.

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | String | the event name
`listener` | function | a function previously registered for this type of event through `on`

Source:
  - stream.js, line 36

##### Returns:

if we could turn it off or not

Type
  Boolean

#### on(type, listener)

Add a listener for a specified event type.

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | String | the event name
`listener` | function | the callback to be invoked when an event of the specified type occurs

Source:
  - stream.js, line 21

#### pipe(destination)

Forwards all `data` events on this stream to the destination stream. The destination stream should provide a method `push` to receive the data events as they arrive.

##### Parameters:

Name | Type | Description
--- | --- | ---
`destination` | Stream | the stream that will receive all `data` events

Source:
  - stream.js, line 95
See:
  - http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options

#### trigger(type)

Trigger an event of the specified type on this stream. Any additional arguments to this function are passed as parameters to event listeners.

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | String | the event name

Source:
  - stream.js, line 53