- plzmasdk
- version ⇒
String
- streamReadSize ⇔
Number
- streamWriteSize ⇔
Number
- ErrorCode
- .unknown ⇒
Number
- .invalidArguments ⇒
Number
- .notEnoughMemory ⇒
Number
- .io ⇒
Number
- .internal ⇒
Number
- .unknown ⇒
- Erase
- FileType
- Method
- OpenDirMode
- .followSymlinks ⇒
Number
- .followSymlinks ⇒
- MultiStreamPartNameFormat
- .nameExt00x ⇒
Number
- .nameExt00x ⇒
- Stat
- .size ⇒
BigInt
- .creation ⇒
Date
- .lastAccess ⇒
Date
- .lastModification ⇒
Date
- .size ⇒
- Path
- new Path()
- new Path([path])
- Path() ⇒
new Path()
- Path([path]) ⇒
new Path([path])
- .toString() ⇒
String
- .openDir([options]) ⇒
PathIterator
- .clear([erase]) ⇒
Path
this/self object. - .set([path]) ⇒
Path
this/self object. - .append([path]) ⇒
Path
this/self object. - .appending([path]) ⇒
Path
- .appendRandomComponent() ⇒
Path
this/self object. - .appendingRandomComponent() ⇒
Path
- .lastComponent() ⇒
Path
- .removeLastComponent() ⇒
Path
this/self object. - .removingLastComponent() ⇒
Path
- .remove([skipErrors]) ⇒
Boolean
- .createDir([withIntermediates]) ⇒
Boolean
- .count ⇒
Number
- .exists ⇒
Number
- .stat ⇒
Stat
- .readable ⇒
Boolean
- .writable ⇒
Boolean
- .readableAndWritable ⇒
Boolean
- Path.tmpPath ⇒
Path
- PathIterator
- Item
- new Item()
- new Item([path, [index]])
- Item() ⇒
new Item()
- Item([path, [index]]) ⇒
new Item([path, [index]])
- .toString() ⇒
String
- .path ⇒
Path
- .index ⇒
Number
- .size ⇒
BigInt
, ⇐BigInt
|Number
- .packSize ⇒
BigInt
, ⇐BigInt
|Number
- .crc32 ⇔
Number
- .creationDate ⇒
Date
, ⇐Date
|Number
- .accessDate ⇒
Date
, ⇐Date
|Number
- .modificationDate ⇒
Date
, ⇐Date
|Number
- .encrypted ⇔
Boolean
- .isDir ⇔
Boolean
- OutStream
- new OutStream()
- new OutStream([path])
- OutStream() ⇒
new OutStream()
- OutStream([path]) ⇒
new OutStream([path])
- .erase([type]) ⇒
Boolean
- .copyContent() ⇒
ArrayBuffer
- .opened ⇒
Boolean
- OutMultiStream
- new OutMultiStream(dirPath, partName, partExtension, format, partSize)
- new OutMultiStream(partSize)
- OutMultiStream(dirPath, partName, partExtension, format, partSize) ⇒
new OutMultiStream(dirPath, partName, partExtension, format, partSize)
- OutMultiStream(partSize) ⇒
new OutMultiStream(partSize)
- .erase([type]) ⇒
Boolean
- .copyContent() ⇒
ArrayBuffer
- .opened ⇒
Boolean
- .streams ⇒
Array
- InStream
- Decoder
- new Decoder(inStream, fileType)
- Decoder(inStream, fileType) ⇒
new Decoder(inStream, fileType)
- .setProgressDelegate([delegate])
- .setPassword([password])
- .open() ⇒
Boolean
- .openAsync() ⇒
Promise
- .abort()
- .itemAt(index) ⇒
Item
- .extract(map< Item, OutStream >) ⇒
Boolean
- .extract(path, [usingItemsFullPath]) ⇒
Boolean
- .extract(array< Item >, path, [usingItemsFullPath]) ⇒
Boolean
- .extractAsync(map< Item, OutStream >) ⇒
Promise
- .extractAsync(path, [usingItemsFullPath]) ⇒
Promise
- .extractAsync(array< Item >, path, [usingItemsFullPath]) ⇒
Promise
- .test([array< Item >]) ⇒
Boolean
- .testAsync([array< Item >]) ⇒
Promise
- .count ⇒
Number
- .items ⇒
Array
- Encoder
- new Encoder(outStream, fileType, method)
- Encoder(outStream, fileType, method) ⇒
new Encoder(outStream, fileType, method)
- .setProgressDelegate([delegate])
- .setPassword([password])
- .add(path, [openDirMode, [archivePath]])
- .add(inStream, archivePath)
- .open() ⇒
Boolean
- .openAsync() ⇒
Promise
- .abort()
- .compress() ⇒
Boolean
- .compressAsync() ⇒
Promise
- .shouldCreateSolidArchive ⇔
Boolean
- .compressionLevel ⇔
Number
- .shouldCompressHeader ⇔
Boolean
- .shouldCompressHeaderFull ⇔
Boolean
- .shouldEncryptContent ⇔
Boolean
- .shouldEncryptHeader ⇔
Boolean
- .shouldStoreCreationDate ⇔
Boolean
- .shouldStoreAccessDate ⇔
Boolean
- .shouldStoreModificationDate ⇔
Boolean
- version ⇒
The full version string of the library generated on build time. Contains version<major, minor, patch> with optional automatic build number, library type, build date/time, os, compiler, environment, usage, features, etc. and original LZMA SDK version.
Read-Write property: receives or updates the size in bytes of the stream's read block per single read request. The lower value requires less amount of allocated memory, but increases the number of read requests and vice versa.
Read-Write property: receives or updates the size in bytes of the stream's write block per single write request. The lower value requires less amount of allocated memory, but increases the number of write requests and vice versa.
Exported object with exception error codes.
The error type cannot be determined. Might be used as a default value during the initialization or generic, unknown exception was catched during the execution.
Provided function or method arguments are invalid.
The required amount of memory can't be alocated or can't instantiate some object.
File or directory doesn't exists or there are no permissions to perform required action.
Any internal errors or exceptions.
Exported object with types of the erasing content.
The content will not be erased, i.e. ignored.
Erase, rewrite the content with zeros.
Exported object with types of the file, stream or data buffer.
7-zip type. This file type supports multiple archive items, password protected items list of the arhive and password protected content. Supports 'LZMA', 'LZMA2' and 'PPMd' compression methods.
XZ type. This file type supports only one arhive item, in a rest it same as 7-zip. Supports only 'LZMA2' compression method which is automatically selected.
TAR type. All archive items are combined and stored as one continuous stream without compression and without password protection. For this type, the 'Method' parameter is ignored.
Exported object with compression methods.
Default and general compression method of 7z format.
Improved version of LZMA.
Dmitry Shkarin's PPMdH with small changes.
Exported object with options for opening directory path. Currently uses for defining behavior of directory iteration.
Follow the symbolic links.
Exported object with options for generating multivolue sub-sctream file name.
"File"."Extension"."002". The maximum number of parts is 999.
Exported object with stat info of the path.
Size in bytes.
Path creation date.
Last path access date.
Last path modification date.
Exported optional path's string presentation.
Constructs empty Path.
Constructs Path with another path presentation.
path
{String|Path} Optional path.
Returns string presentation of the path.
const path = Path('a/b/c');
console.log(`path: ${path}`); // => 'a/b/c'
Path.openDir([options]) ⇒ PathIterator
Opens a directory associated with path for iterating the content.
options
{OpenDirMode|Array<OpenDirMode>} Optional mode.
Path.clear([erase]) ⇒ Path this/self object
Clears the path object's string presentation.
erase
{Erase} Optional type of erasing of the path data.
Path.set([path]) ⇒ Path this/self object
Set the new path from optional source path.
path
{[String|Path} Optional source string or path object.
Path.append([path]) ⇒ Path this/self object
Appends path component to path object.
path
{[String|Path} Optional string or path object.
Path.appending([path]) ⇒ Path
Returns new Path object by appending provided path argument to the receiver.
path
{[String|Path} Optional string or path object.
Path.appendRandomComponent() ⇒ Path this/self object
Appends random path component to the path object. If path successfully updated, then the updated path doesn't exists in a root directory. The component consists of ASCII characters in range ['a'; 'z'].
Path.appendingRandomComponent() ⇒ Path
Returns new Path object by appending random path component to the receiver.
Path.lastComponent() ⇒ Path
Receives the last component of the path. The result is new instance of the path object representing the last component.
Path.removeLastComponent() ⇒ Path this/self object.
Removes the last component from the path.
Path.removingLastComponent() ⇒ Path
Returns new Path object by removing last path component from the receiver.
Physically removes the directory with all content or file associated with the path.
skipErrors
{Boolean} Optionaly skips errors and continuing removing or stop on first error.
Creates the directory at specific path.
withIntermediates
{Boolean} Optionaly create intermediate directories for each component or not.
The number of unicode characters in a path string presentation.
Checks the path exists. Returns: 1 - file exists, 2 - directory exists, 0 - doesn't exist.
Path.stat ⇒ Stat
Provides the stat info of the path.
Checks the path exists and has read permissions.
Checks the path exists and has write permissions.
Checks the path exists and has read-write permissions.
Path.tmpPath ⇒ Path
Provides the path with the platform specific temporary directory for the library. The provided directory path, if such exists, has a read-write permissions.
Path iterator object.
Continue iteration.
Closes iteration.
PathIterator.path ⇒ Path
Recevies the current file or directory path.
PathIterator.component ⇒ Path
Recevies the current file or directory component.
PathIterator.fullPath ⇒ Path
Recevies the current file or directory full path, prefixed with root path.
Checks the current iterator's path is directory.
The archive item.
Constructs empty Item.
Constructs the Item with optional path and optional index in the archive.
path
{String|Path} Optional, associated item's path.index
{Number} Optional index of the item in the archive.
Returns string presentation of the item.
const item = Item('a/b/c', 0);
console.log(`item: ${item}`);
Item.path ⇒ Path
Receives the item's path object.
Receives the item's index inside the archive.
Read-Write property: receives or updates the item's index inside the archive.
Read-Write property: receives or updates the packed size in bytes of the item.
Read-Write property: receives or updates the CRC-32 checksum of the items content.
Read-Write property: receives or updates the creation date of the item.
Read-Write property: receives or updates the access date of the item.
Read-Write property: receives or updates the modification date of the item.
Read-Write property: receives or updates the item is encrypted.
Read-Write property: receives or updates the item is directory or file.
The output file stream.
Constructs the output file stream object for writing to memory.
Constructs the output file stream object for writing to file.
path
{String|Path} Optional output file path. In case if there is no path argument, the memory stream will be created.
Erases and removes the content of the stream.
type
{Erase} Optional type of erasing the content.
Copies the content of the stream to a heap memory. The stream must be closed.
Checks the output file stream is opened.
The output multi volume/part stream.
Constructs the output multi stream with directory path, part name, extension, format and part size. All sub-streams are file streams.
dirPath
{String|Path} The non-empty output directory path.partName
{String} The non-empty output file name.partExtension
{String} Optional extension.format
{MultiStreamPartNameFormat} Format of the result file name part.format
{Number} The maximum size in bytes of each out file sub-stream.
Constructs the output multi stream object for writing to memory. All sub-streams are memory streams.
format
{Number} The maximum size in bytes of each out file sub-stream.
Receives array of created OutStream sub-streams. The stream must be closed. If stream is opened, then the list is empty.
The input file stream.
Constructs the input file stream object for reading a file content from path.
path
{String|Path} File path or path string.
Constructs the input file stream object for reading a file content.
fileContent
{ArrayBuffer} Input file content.
Constructs the multi input stream with a list of input streams. The array should not be empty. The order: file.001, file.002, ..., file.XXX
array
{[ InStream ]} The non-empty array of input streams. Each stream inside the list should also exist.
Erases and removes the content of the stream.
type
{Erase} Optional type of erasing the content.
Checks the input file stream is opened.
The decoder for extracting or testing the archive items.
Constructs the decoder with input file stream and file type.
inStream
{InStream} The input stream which contains the archive file content. After successful opening, the input stream will be opened as long as a decoder exists.fileType
{FileType} The type of the arhive file content.
Provides the extract or test progress delegate.
delegate
{function(path{String}, progress{Number})} Optional delegate function to report the progress.
Provides the archive password for opening, extracting or testing items.
password
{String} Optional password.
Opens the archive.
Asynchronously opens the archive. The opening progress might be aborted via abort() function. After successful opening, the input stream will be opened as long as a decoder exists.
Aborts opening, extracting or testing process. The aborted decoder is no longer valid.
Decoder.itemAt(index) ⇒ Item
Receives a single archive item at a specific index.
index
{Number} The index of the item inside the arhive. Must be less than the number of items reported by the count() property.
Extracts each archive item to a separate out-stream.
Extracts all archive items to a specific path.
path
{String|Path} The directory path to extract all items.usingItemsFullPath
{Boolean} Optionally extract item using it's full path or only last path component. Default is {true}.
Decoder.extract(array<Item>, path, [usingItemsFullPath]) ⇒ Boolean
Extracts some archive items to a specific path.
array
{Array} The array of items to extract.usingItemsFullPath
{Boolean} Optionally extract item using it's full path or only last path component. Default is {true}.
Asynchronously extracts each archive item to a separate out-stream. The extracting progress might be aborted via abort() function.
Asynchronously extracts all archive items to a specific path. The extracting progress might be aborted via abort() function.
path
{String|Path} The directory path to extract all items.usingItemsFullPath
{Boolean} Optionally extract item using it's full path or only last path component. Default is {true}.
Decoder.extractAsync(array<Item>, path, [usingItemsFullPath]) ⇒ Promise
Asynchronously extracts some archive items to a specific path. The extracting progress might be aborted via abort() function.
array
{Array} The array of items to extract.usingItemsFullPath
{Boolean} Optionally extract item using it's full path or only last path component. Default is {true}.
Tests all or specific archive items.
array
{Array} Optional array of items to test.
Asynchronously tests all or specific archive items. The testing progress might be aborted via abort() function.
array
{Array} Optional array of items to test.
Receives the number of items in archive. The decoder must be opened.
Receives array with all archive items. The decoder must be opened.
The decoder compressing the archive items.
Constructs the encoder with output file stream, file type and method.
outStream
{OutStream|OutMultiStream} The output file stream to write the archive's file content.fileType
{FileType} The type of the arhive file content.method
{Method} The compresion method.
Provides the compression progress delegate.
delegate
{function(path{String}, progress{Number})} Optional delegate function to report the progress.
Provides the archive password. This password will be used for encrypting header and the content if such options are enabled and selected type supports password protection. See .shouldEncryptHeader, .shouldEncryptContent properties and FileType enum.
password
{String} Optional password. Non-string type or zero length password means no password provided.
Adds the physical file or directory path to the encoder. Duplicated path is not allowed.
path
{String|Path} The file or directory path.openDirMode
{OpenDirMode|Array<OpenDirMode>} Optional mode for opening directory in case if path is a directory path.archivePath
{String|Path} Optional path of how the item's path will be presented in archive.
Adds the file in-stream to the encoder.
inStream
{InStream} The input file stream to add. Empty stream is not allowed.archivePath
{String|Path} The path of how the item's path will be presented in archive. Empty path is not allowed.
Opens the archive.
Returns false
if nothing to compress or encoder aborted or incorrect number of items or number of items greater than supported, otherwise true
.
Asynchronously opens the archive. The testing progress might be aborted via abort() function.
Returns false
if nothing to compress or encoder aborted or incorrect number of items or number of items greater than supported, otherwise true
.
Aborts the opening or compressing process.
Compresses the provided paths and streams.
Asynchronously compresses the provided paths and streams.
Read-Write property: receives or updates for a 'solid' archive property. Default true.
Read-Write property: receives or updates compression level. The level in a range [0; 9].
Read-Write property: should encoder compress the archive header. Default true.
Read-Write property: should encoder fully compress the archive header. Default true.
The encryption will take place only if this option enabled, the type supports password protection and the password has been provided. See .setPassword([password]) function and FileType enum. Read-Write property: should encoder encrypt the content of the archive items. The password will be required to decode/extract archive items.
The encryption will take place only if this option enabled, the type supports password protection and the password has been provided. See .setPassword([password]) function and FileType enum. Read-Write property: should encoder encrypt the header with the list of archive items. The password will be required to open archive and list the items.
Read-Write property: should encoder store the creation date of each item to the header if such available. Default true.
Read-Write property: should encoder store the last access date of each item to the header if such available. Default true.
Read-Write property: should encoder store the last modification date of each item to the header if such available. Default true.