Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process exited before Archiver could finish emitting data at #1

Open
tabacha opened this issue Sep 6, 2016 · 2 comments
Open

Process exited before Archiver could finish emitting data at #1

tabacha opened this issue Sep 6, 2016 · 2 comments

Comments

@tabacha
Copy link

tabacha commented Sep 6, 2016

I have tried to start with the example in readme.md.
I have created an ott file and added some document variable in it.

Then i have started the following code:

var fs = require('fs')
  , odt = require('odt')
  , template = odt.template
  , createWriteStream = fs.createWriteStream
var doc = 'ADFC-Antrag.ott';
var values = {
    'Polizei_K': { type: 'string', value: '99' },
    'Polizei_Str':{ type: 'string', value: 'Musterstr 42' },
    'Polizei_PLZ':{ type: 'string', value: '21149' },
};

// apply values
template(doc)
  .apply(values)
  .on('error', function(err){
    throw err;
  })
  .finalize(function(bytes){
    console.log('The document is ' + bytes + ' bytes large.');
  })
  .pipe(createWriteStream('mydocument.odt'))
  .on('close', function(){
    console.log('document written');
  });

Result

/home/sven/testodt/node_modules/odt/node_modules/archiver/lib/archiver/core.js:79
      throw new Error('Process exited before Archiver could finish emitting da
            ^
Error: Process exited before Archiver could finish emitting data
    at null.<anonymous> (/home/sven/testodt/node_modules/odt/node_modules/archiver/lib/archiver/core.js:79:13)
    at process.g (events.js:180:16)
    at process.EventEmitter.emit (events.js:95:17)
@domachine
Copy link
Member

Hey, I'm so sorry. But I currently don't have the time to work actively on this repository. I think the problem you describe is a consequence of the too old archive module, that is in use here. This guy here forked this repository and migrated: https://www.npmjs.com/package/odt-new-archiver. I don't know if it works, but you can try it. Pull-requests to my repository here will be happily accepted or if you're interested in helping out, let me know. Hopefully you didn't waste too much time. I'm really sorry. I'll drop a note on the readme about the missing maintenance.

@hgoebl
Copy link

hgoebl commented Aug 4, 2017

Unfortunately the odt-new-archiver is not working either. And I regard npm packages without a valid link to a Git repository suspect.

Neverless, thanks @domachine for your inspiration how to deal with ODF documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants