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

TypeError: Converter is not a constructor #44

Closed
w3nl opened this issue Mar 3, 2022 · 1 comment · Fixed by #45
Closed

TypeError: Converter is not a constructor #44

w3nl opened this issue Mar 3, 2022 · 1 comment · Fixed by #45

Comments

@w3nl
Copy link
Owner

w3nl commented Mar 3, 2022

#1 (comment)

const Converter = require('ppt-png')

new Converter({
files: ['peka.pptx'],
output: 'output/',
invert: false,
logLevel: 2,
callback: function(data){
console.log(data.files, data.success, data.files, data.time)
}
}).run()

TypeError: Converter is not a constructor
@w3nl w3nl mentioned this issue Mar 3, 2022
@w3nl w3nl closed this as completed in #45 Mar 3, 2022
@w3nl
Copy link
Owner Author

w3nl commented Mar 3, 2022

@AlexanderKozhevin

It works, but in version 1.x.x there are breaking changes.
It works now like:

const converter = Converter.create({
  files: ['peka.pptx'],
  output: 'output/'
});

const result = converter.convert();

console.log(result);

I have to add some missing features from 0.x like invert, but i think the current codebase is more clean and easier to maintain for me.

Now it's based on a generic convert package: https://www.npmjs.com/package/%40hckrnews%2Fconverter
And have split the 2 converters to new packages:
https://www.npmjs.com/package/%40hckrnews%2Fpdf2png
https://www.npmjs.com/package/%40hckrnews%2Fppt2pdf
So this ppt-png will run both converters:
https://github.com/w3nl/ppt-png/blob/master/src/converter.js#L39

Check also the example code in the codebase and the readme like:
https://github.com/w3nl/ppt-png/blob/master/test/test2.js

For all features, you can use version 0.x.x with the old code style for running this converter.

@w3nl w3nl mentioned this issue Mar 3, 2022
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

Successfully merging a pull request may close this issue.

1 participant