new MockettaroProgram( argv, cwd ) → {Promise.<number>}

Parameters
Name Type Description
argv Array.<string> command line arguments
cwd string | function Current Working Directory
Returns
Returns the copy process final status

Members


<static, readonly> RESOURCE_MATCHER

Properties
Name Type Description
RESOURCE_MATCHER RegExp
Examples
MockettaroProgram.RESOURCE_MATCHER

<static, readonly> FOLDER_MATCHER

Properties
Name Type Description
FOLDER_MATCHER RegExp
Examples
MockettaroProgram.FOLDER_MATCHER

<static, readonly> DEFAULT_PORT

Properties
Name Type Description
DEFAULT_PORT number
Examples
MockettaroProgram.DEFAULT_PORT

<static, readonly> DEFAULT_RESOURCE

Properties
Name Type Description
DEFAULT_RESOURCE string
Examples
MockettaroProgram.DEFAULT_RESOURCE

<static, readonly> DEFAULT_FOLDER

Properties
Name Type Description
DEFAULT_FOLDER string
Examples
MockettaroProgram.DEFAULT_RESOURCE

<static, readonly> DEFAULT_DELAY

Properties
Name Type Description
DEFAULT_DELAY number
Examples
MockettaroProgram.DEFAULT_DELAY

<static, readonly> DEFAULT_CACHE_LIFETIME

Properties
Name Type Description
DEFAULT_CACHE_LIFETIME number
Examples
MockettaroProgram.DEFAULT_CACHE_LIFETIME

<static, readonly> MIN_PORT

Properties
Name Type Description
MIN_PORT number
Examples
MockettaroProgram.MIN_PORT

<static, readonly> MAX_PORT

Properties
Name Type Description
MAX_PORT number
Examples
MockettaroProgram.MAX_PORT

<static, readonly> MAX_DELAY

Properties
Name Type Description
MAX_DELAY number
Examples
MockettaroProgram.MAX_DELAY

<static, readonly> MAX_CACHE_LIFETIME

Properties
Name Type Description
MAX_CACHE_LIFETIME number
Examples
MockettaroProgram.MAX_CACHE_LIFETIME

Methods


<static> numericArgParser( matcher, min, max ) → {function}

Parameters
Name Type Description
matcher RegExp Number regexp matcher
min number Lower limit
max number Upper limit
Returns
Parser
Examples
MockettaroProgram.numericArgParser(/\d+/, 0, 100)

<static> cmdParser( argv ) → {Commander}

Parameters
Name Type Description
argv Array.<string> command line arguments
Returns
Returns a commander instanced with parsed argv
Examples
MockettaroProgram.cmdParser('abc', 'abc', '-p', '...')