tdecaluwe / node-edifact

Javascript stream parser for UN/EDIFACT documents.
https://www.npmjs.com/package/edifact
Apache License 2.0
50 stars 13 forks source link

Reading an Edifact document via Reader currently fails #32

Closed RovoMe closed 4 years ago

RovoMe commented 4 years ago

In version 1.2.8 attempting to read a file via Reader fails as close() invoked is undefined:

..../node_modules/edifact/reader.js:67
  this._parser.write(document).close();
                              ^

TypeError: Cannot read property 'close' of undefined
    at Reader.parse (.../node_modules/edifact/reader.js:67:31)

The README also contains this sample at the end of the usage section while the given example in definitions.js contains this sample:

parser.encoding('UNOA');
parser.write(document);
parser.end();