zipfilemap

    1.0.1 • Public • Published

    zipfilemap

    Build Status Coverage Status

    Zipfilemap maps a zipfiles from URLs or buffers to JavaScript dictionaries.

    Usage Examples

    Read the contents of a zipfile into a JavaScript dictionary

    const zipfilemap = require('zipfilemap');
    const fs = require('fs');
     
    const zipBuffer = fs.readFileSync('/path/to/myfile.zip');
     
    async function myTestFunction() {
          zipDict = await zipfilemap.fromBuffer(zipBuffer);
          
          Object.keys(zipDict).forEach((key)=>{
        console.log("zipFile contains file " + key + " which has a file with contents " + zipDict[key]);
          });
    }

    Read a zipfile from the web into a JavaScript dictionary

    const zipfilemap = require("zipfilemap");
     
    async function myTestFunction() {
          options = {
            uri: 'http://localhost/test.zip'
          }
          zipDict = await zipfilemap.fromLink(options);
          
          Object.keys(zipDict).forEach((key)=>{
        console.log("zipFile contains file " + key + " which has a file with contents " + zipDict[key]);
          });
    }

    Install

    npm i zipfilemap

    DownloadsWeekly Downloads

    39

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    7.6 kB

    Total Files

    4

    Last publish

    Collaborators

    • tomcoded