https://github.com/postor/zip-list-entry
list entry from zip file
https://github.com/postor/zip-list-entry
entry zip
Last synced: 2 months ago
JSON representation
list entry from zip file
- Host: GitHub
- URL: https://github.com/postor/zip-list-entry
- Owner: postor
- Created: 2017-02-14T02:58:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T07:39:48.000Z (over 8 years ago)
- Last Synced: 2025-02-26T19:20:07.015Z (3 months ago)
- Topics: entry, zip
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zip-list-entry
list entry from zip file | 从zip文件获取完整的目录文件结构
## install | 安装
```
npm install zip-list-entry --save
```
## usage | 使用
```
var listEntries = require('zip-list-entry')
var path = require('path')
var file = path.join(__dirname,'test.zip')listEntries(file,{
return: Object
}).then(function(entries){
console.log(JSON.stringify(entries))
},function(err){
console.log(err)
})
```## result | 结果
```
//return: Array
["1/","1/a/","1/a/x/","1/a/x/a.txt","1/b/","1/c/","2/","3/","test.js"]
//return: Object
{"1":{"a":{"x":{"a.txt":"1/a/x/a.txt"}},"b":{},"c":{}},"2":{},"3":{},"test.js":"test.js"}
```