src/libarchive.js
/**
     * Returns object containing directory structure and extracted File objects 
     * @param {Function} extractCallback
     * 
     */
Returns object containing directory structure and extracted File objects
@param {Function} extractCallback
Returns object containing directory structure and extracted File objects @param { Function } extractCallback
extractFiles(extractCallback){
        if( this._processed > 1 ){
            return Promise.resolve().then( () => this._content );
        }
        return this._postMessage({type: 'EXTRACT_FILES'}, (resolve,reject,msg) => {
            if( msg.type === 'ENTRY' ){
                const [ target, prop ] = this._getProp(this._content,msg.entry.path);
                if( msg.entry.type === 'FILE' ){
                    target[prop] = msg.entry.file;
                    setTimeout(extractCallback.bind(null,{
                        file: msg.entry.file,
                        path: msg.entry.path,
                    }));
                }
                return true;
            }else if( msg.type === 'END' ){
                this._processed = 2;
                this._worker.terminate();
                resolve(this._cloneContent(this._content));
            }
        });
    }
extractFiles ( extractCallback ) { if ( this . _processed > 1 ) { return Promise . resolve ( ) . then ( ( ) => this . _content ) ; } return this . _postMessage ( { type : 'EXTRACT_FILES' } , ( resolve , reject , msg ) => { if ( msg . type === 'ENTRY' ) { const [ target , prop ] = this . _getProp ( this . _content , msg . entry . path ) ; if ( msg . entry . type === 'FILE' ) { target [ prop ] = msg . entry . file ; setTimeout ( extractCallback . bind ( null , { file : msg . entry . file , path : msg . entry . path , } ) ) ; } return true ; } else if ( msg . type === 'END' ) { this . _processed = 2 ; this . _worker . terminate ( ) ; resolve ( this . _cloneContent ( this . _content ) ) ; } } ) ; }
Returns object containing directory structure and extracted File objects
 @param {Function} extractCallback
Returns object containing directory structure and extracted File objects @param { Function } extractCallback