<commit_before>=== Message
The message object is the 'data' object which will be send from step to step.

.Example message format
[source,js]
----
{
  "header": {},						<1>
  "hops": [								<2>
    {
      "time": Date.now(),
      "id": uuid.create(4).toString(),
      "step": stepName,
      "host": os.hostname()
    }
  ],
  "payload": {}						<3>
}
----
<1> The header is just a JSON object. It contain what ever. Each step may manipulate the
	data. Add new one or delete old one.
<2> An array of objects. On each step a messages passes a new entry will be added.
This data could be used to check which way a message comes from, or how long it is underway.
Also the data could be used if messages where splitted and needs to be aggregated later on.
<3> The payload could be anything. It the most cases it would be a nodejs stream. 
<commit_msg>Update documentation<commit_after>=== Message
The message object is the 'data' object which will be send from step to step.

.Example message format
[source,js]
----
{
  "header": {},						<1>
  "hops": [								<2>
    {
      "time": Date.now(),
      "id": uuid.create(4).toString(),
      "step": stepName,
      "host": os.hostname()
    }
  ],
  "payload": {}						<3>
}
----
<1> The header is just a JSON object. It contain what ever. Each step may manipulate the
	data. Add new one or delete old one.
<2> An array of objects. On each step a messages passes a new entry will be added.
This data could be used to check which way a message comes from, or how long it is underway.
Also the data could be used if messages where splitted and needs to be aggregated later on.
<3> The payload could be anything. It the most cases it would be a nodejs stream.

==== Message methods
The message object has some convenience methods.

constructor::
	Creates a new message object. The 'header' and 'message' parameter are optional.
	If the header is given it will be added to the message. If a message parameter is given
	it will clone the existing message and merges the given header into it.
	On each hop the message will be cloned. Because if a step sends out an incoming message
	to two or more ''out'' endpoints an own object is needed.
+
.Example endpoint creation
[source,js]
----
const messageFactory = require('kronos-step').message;

const newMessage = messageFactory(header, message);
----

addHop::
	This will add a new 'hop' to this message. This will be done on each step.
+
[source,js]
----
message.addHop(stepName);
----

{'fraction_non_alphanumeric': 0.10181086519114688, 'fraction_numerical': 0.005633802816901409, 'mean_word_length': 3.102310231023102, 'pattern_counts': {'":': 14, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3343832', 'n_tokens_mistral': 753, 'n_tokens_neox': 716, 'n_words': 370}