Constructor
new DocumentTagger(opts)
Create a new DocumentTagger stream.
Parameters:
Name | Type | Description |
---|---|---|
opts |
DocumentTaggerSettings | Settings for the stream. |
- Source:
Fires:
Example
const docTagger = new DocumentTagger({autoIncrement: 'id', mutate: { project: 'test' }});
someReadableStreamFromArray([{text: 'abc'}, {text: 'efg'}])
.pipe(docTagger)
.pipe(process.stdout);
// stdout >
// {"text": "abc", "id": 0, "project": "test"}
// {"text": "efg", "id": 1, "project": "test"}
Extends
- stream.Transform