gildas-lormeau / zip.js

JavaScript library to zip and unzip files supporting multi-core compression, compression streams, zip64, split files and encryption.
https://gildas-lormeau.github.io/zip.js
BSD 3-Clause "New" or "Revised" License
3.38k stars 510 forks source link

How import zipDirectoryEntry? #401

Closed galvakojis closed 1 year ago

galvakojis commented 1 year ago

Not sure how to import zipDirectoryEntry

At the moment I am doing like this, but it is not working, not sure why? import { ZipWriter, BlobWriter, ZipDirectoryEntry} from '@zip.js/zip.js';

Error: export 'ZipDirectoryEntry' (imported as 'ZipDirectoryEntry') was not fou
nd in '@zip.js/zip.js' (possible exports: BlobReader, BlobWriter, Data64URIReader, Data64URIWriter, ERR_BAD_FORMAT, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_DUPLICATED_NAME, ERR_ENCRYPTED, ERR_EOCDR_LOCATOR_ZIP64_NO
T_FOUND, ERR_EOCDR_NOT_FOUND, ERR_EOCDR_ZIP64_NOT_FOUND, ERR_EXTRAFIELD_ZIP64_NOT_FOUND, ERR_HTTP_RANGE, ERR_INVALID_COMMENT, ERR_INVALID_ENCRYPTION_STRENGTH, ERR_INVALID_ENTRY_COMMENT, ERR_INVALID_ENTRY_NAME, E
RR_INVALID_EXTRAFIELD_DATA, ERR_INVALID_EXTRAFIELD_TYPE, ERR_INVALID_PASSWORD, ERR_INVALID_SIGNATURE, ERR_INVALID_VERSION, ERR_ITERATOR_COMPLETED_TOO_SOON, ERR_LOCAL_FILE_HEADER_NOT_FOUND, ERR_SPLIT_ZIP_FILE, ER
R_UNSUPPORTED_COMPRESSION, ERR_UNSUPPORTED_ENCRYPTION, ERR_UNSUPPORTED_FORMAT, HttpRangeReader, HttpReader, Reader, SplitDataReader, SplitDataWriter, SplitZipReader, SplitZipWriter, TextReader, TextWriter, Uint8
ArrayReader, Uint8ArrayWriter, Writer, ZipReader, ZipWriter, configure, fs, getMimeType, initShimAsyncCodec, terminateWorkers)
galvakojis commented 1 year ago

Found it!

Do this: import { ZipWriter, BlobWriter, fs } from '@zip.js/zip.js';

later init like this: const zipEntry = new fs.ZipDirectoryEntry();

Stilt don't know how

gildas-lormeau commented 1 year ago

Feel free to create a post in the Discussions tab if you have have questions that are not bugs/feature requests. I'll do my best to help you.