1.3.4 • Published 4 years ago

ls-archive v1.3.4

Weekly downloads
1,206
License
-
Repository
github
Last release
4 years ago

Node Ls Archive Module Build Status

List or read the files and folders inside archive files.

Supported file extensions:

  • .epub
  • .jar
  • .love
  • .nupkg
  • .tar
  • .tar.gz
  • .tgz
  • .war
  • .zip
  • .egg
  • .whl
  • .xpi

Installing

npm install ls-archive

Building

  • Clone the repository
  • Run npm install
  • Run grunt to compile CoffeeScript code
  • Run grunt test to run the specs

Using

archive = require 'ls-archive'

archive.list(archivePath, callback)

List the files and folders inside the archive file path. The callback gets two arguments (error, archiveEntries).

archivePath - The string path to the archive file.

callback - The function to call after reading completes with an error or an array of ArchiveEntry objects.

archive.readFile(archivePath, filePath, callback)

Read the contents of the file path in the archive path and invoke the callback with those contents. The callback gets two arguments (error, filePathContents).

archivePath - The string path to the archive file.

filePath - The string path inside the archive to read.

callback - The function to call after reading completes with an error or the Buffer contents.

archive.readGzip(gzipArchivePath, callback)

Read the contents of the gzipped archive path and invoke the callback with the Buffer contents of the uncompressed paths. The callback gets two arguments (error, pathContents).

gzipArchivePath - The string path to the gzipped archive file.

callback - The function to call after reading completes with an error or the Buffer contents.

ArchiveEntry

Class representing a path entry inside an archive file.

.isFile()

Is the entry a file?

Returns true if a file, false otherwise.

.isFolder()

Is the entry a folder?

Returns true if a folder, false otherwise.

.isSymbolicLink()

Is the entry a symbolic link?

Returns true if a symbolic link, false otherwise.

.getPath()

Get the path of this entry.

Returns the string path.

1.3.4

4 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

7 years ago

1.2.2

8 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.13.0

10 years ago

0.12.0

10 years ago

0.11.0

10 years ago

0.10.0

10 years ago

0.9.0

11 years ago

0.8.0

11 years ago

0.7.0

11 years ago

0.6.0

11 years ago

0.5.0

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago