Work around to extract Zip/PDF Document from MWS Base64-encoded string mws api response.
- GetPackageLabels
- GetUniquePackageLabels
- GetPalletLabels
- GetBillOfLading
$ npm install mws-extract-document --save
const mwsExtract = require('mws-extract-document');
const dist = './folder/to/document.zip';
const base64String = ''; //located at PdfDocument data response from MWS api.
// PROMISE
mwsExtract(base64String, dist)
.then((msg)=>{
// file saved. do something here...
console.log(msg);
})
.catch(err)=>{
console.log(err);
});MIT © Jorge Rosal