mws-extract-document

Extracting ZIP/PDF document from mws base64 string api response.

Usage no npm install needed!

<script type="module">
  import mwsExtractDocument from 'https://cdn.skypack.dev/mws-extract-document';
</script>

README

mws-extract-document

Work around to extract Zip/PDF Document from MWS Base64-encoded string mws api response.

MWS End-Points

  • GetPackageLabels
  • GetUniquePackageLabels
  • GetPalletLabels
  • GetBillOfLading

Install

$ npm install mws-extract-document --save

Basic Usage

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);
          });

License

MIT © Jorge Rosal