Use other npm cordova packages like cordova-plugin-cszbar in ionic2 typescript

Hi all,

since the ionic-native barcodescanner is due to the implementation not able to enable the torch per default, i wanted to use the cordova-plugin-cszbar.

But i absolutely don’t know how to get that thing working.

I enabled it with ionic plugins add cordova-plugin-cszbar --save

Adding the javscript file in index.html results in “require not defined” at “require(‘cordova/argscheck’)” and there are no typings for the package available, and i don’t know how to create them.

There must be an easy way of using cordova plugins that are not within ionic-native.

I also tried declare var ZBar: any but it doesn’t seem to be available anywhere.

1 Like