Class: Samson

Samson

new Samson(def)

Main object used when running the node-samson script. This object wraps the functionality of three internally defined modules module:node-samson/lib/ResourceReader, module:node-samson/lib/ResourceWriteer, and module:node-samson/lib/ResourceProcessor. This object binds to events that are emitted by instances of each of these modules, and then emits its own events defined within the Samson.event namespace.
Parameters:
Name Type Argument Description
def Object <optional>
Since:
  • 1.0
Source:
  • Samson.js, line 259
Fires:

Extends

  • module:events.EventEmitter

Namespaces

errorCode
event

Members

<static> options :boolean

Since:
  • 1.0
Source:
  • Samson.js, line 544

def :Object

Since:
  • 1.0
Source:
  • Samson.js, line 297

error :Error

Since:
  • 1.0
Source:
  • Samson.js, line 302

options :Error

Since:
  • 1.0
Source:
  • Samson.js, line 307

packageInfo :Object

Since:
  • 1.0
Source:
  • Samson.js, line 312

<readonly> processor :ResourceProcessor

Since:
  • 1.0
Source:
  • Samson.js, line 170

<readonly> reader :ResourceReader

Since:
  • 1.0
Source:
  • Samson.js, line 158

reading :boolean

Since:
  • 1.0
Source:
  • Samson.js, line 317

writeManifest :Function

Since:
  • 1.0
Source:
  • Samson.js, line 327

<readonly> writer :ResourceWriter

Since:
  • 1.0
Source:
  • Samson.js, line 164

writing :boolean

Since:
  • 1.0
Source:
  • Samson.js, line 322

Methods

createLogger(writeStream) → {Function}

Parameters:
Name Type Description
writeStream fs.WriteStream
Since:
  • 1.0
Source:
  • Samson.js, line 335
Returns:
Type
Function

getReadStreamFromWritePath(file) → {module:fs.ReadStream}

Since the purpose of this object is the process or copy files from one location to another, this is a helper method that allows retrieval of the stream reading the original file based on the new file's destination.
Parameters:
Name Type Description
file string
Since:
  • 1.0
Source:
  • Samson.js, line 400
Returns:
ReadStream instance
Type
module:fs.ReadStream

getWriteStreamFromReadPath(file) → {module:fs.WriteStream}

Since the purpose of this object is the process or copy files from one location to another, this is a helper method that allows retrieval of the stream writing the new file based on the original file's location.
Parameters:
Name Type Description
file string
Since:
  • 1.0
Source:
  • Samson.js, line 416
Returns:
WriteStream instance
Type
module:fs.WriteStream

reset() → {Samson}

Since:
  • 1.0
Source:
  • Samson.js, line 428
Throws:
Error
Returns:
this
Type
Samson

run(patterns, options) → {Samson}

This method is the main entry point of the process of reading, processing, and writing files.
Parameters:
Name Type Argument Description
patterns Array
options Object <optional>
Since:
  • 1.0
Source:
  • Samson.js, line 457
Throws:
Error
Returns:
this
Type
Samson