Comparing version 5.0.0 to 6.0.0
@@ -25,2 +25,1 @@ 'use strict'; | ||
}); | ||
'use strict'; | ||
const process = require('node:process'); | ||
const isString = (a) => typeof a === 'string'; | ||
const { | ||
@@ -7,2 +9,3 @@ createReadStream, | ||
} = require('fs'); | ||
const { | ||
@@ -13,2 +16,3 @@ mkdir, | ||
} = require('fs/promises'); | ||
const path = require('path'); | ||
@@ -35,3 +39,3 @@ const {EventEmitter} = require('events'); | ||
function check(from, to, files) { | ||
assert(typeof from === 'string', 'from should be a string!'); | ||
assert(isString(from), 'from should be a string!'); | ||
assert(/string|object/.test(typeof to), 'to should be string or object!'); | ||
@@ -167,4 +171,3 @@ | ||
const streamFile = typeof _to === 'object' ? | ||
_to : createWriteStream(_to); | ||
const streamFile = typeof _to === 'object' ? _to : createWriteStream(_to); | ||
@@ -229,2 +232,3 @@ const [errorPipe] = await tryToCatch(pipe, [ | ||
const autoClose = true; | ||
const options = { | ||
@@ -257,3 +261,3 @@ lazyEntries, | ||
if (/\/$/.test(fileName)) { | ||
if (fileName.endsWith('/')) { | ||
const [e] = await tryToCatch(mkdir, name, { | ||
@@ -268,2 +272,3 @@ recursive: true, | ||
let e; | ||
[e] = await tryToCatch(mkdir, dirname(name), { | ||
@@ -276,6 +281,3 @@ recursive: true, | ||
[e] = await tryToCatch(pipe, [ | ||
readStream, | ||
createWriteStream(name), | ||
]); | ||
[e] = await tryToCatch(pipe, [readStream, createWriteStream(name)]); | ||
@@ -313,2 +315,1 @@ fn(e); | ||
} | ||
@@ -15,7 +15,3 @@ 'use strict'; | ||
link, | ||
} = await inhale(finder, [ | ||
'file', | ||
'directory', | ||
'link', | ||
]); | ||
} = await inhale(finder, ['file', 'directory', 'link']); | ||
@@ -35,2 +31,1 @@ const names = [ | ||
}; | ||
{ | ||
"name": "onezip", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"description": "pack and extract .zip archives with emitter", | ||
@@ -9,3 +9,3 @@ "type": "commonjs", | ||
"bin": { | ||
"onezip": "bin/onezip.js" | ||
"onezip": "bin/onezip.mjs" | ||
}, | ||
@@ -27,6 +27,6 @@ "scripts": { | ||
"findit2": "^2.2.3", | ||
"glob": "^7.0.0", | ||
"glob": "^10.3.10", | ||
"pipe-io": "^4.0.0", | ||
"try-to-catch": "^3.0.0", | ||
"yargs-parser": "^20.2.4", | ||
"yargs-parser": "^21.1.1", | ||
"yauzl": "^2.6.0", | ||
@@ -36,19 +36,18 @@ "yazl": "^2.4.1" | ||
"devDependencies": { | ||
"@cloudcmd/stub": "^3.1.0", | ||
"@iocmd/wait": "^1.0.0", | ||
"coveralls": "^3.0.0", | ||
"eslint": "^7.3.1", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-putout": "^6.11.0", | ||
"madrun": "^8.2.0", | ||
"@cloudcmd/stub": "^4.0.1", | ||
"@iocmd/wait": "^2.1.0", | ||
"eslint": "^9.0.0-alpha.2", | ||
"eslint-plugin-n": "^16.6.2", | ||
"eslint-plugin-putout": "^22.3.1", | ||
"madrun": "^10.0.1", | ||
"mock-require": "^3.0.2", | ||
"nodemon": "^2.0.2", | ||
"nodemon": "^3.0.3", | ||
"nyc": "^15.0.0", | ||
"putout": "^13.1.2", | ||
"rimraf": "^3.0.0", | ||
"supertape": "^4.1.0", | ||
"putout": "^35.0.1", | ||
"rimraf": "^5.0.5", | ||
"supertape": "^10.0.0", | ||
"try-catch": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=14" | ||
"node": ">=18" | ||
}, | ||
@@ -55,0 +54,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
# OneZip [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
# OneZip [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
@@ -48,10 +48,6 @@ Pack and extract .zip archives with emitter. | ||
const name = 'pipe.tar.gz'; | ||
const from = cwd + '/pipe-io'; | ||
const from = `${cwd}/pipe-io`; | ||
const to = path.join(cwd, name); | ||
const pack = onezip.pack(from, to, [ | ||
'LICENSE', | ||
'README.md', | ||
'package.json', | ||
]); | ||
const pack = onezip.pack(from, to, ['LICENSE', 'README.md', 'package.json']); | ||
@@ -67,3 +63,3 @@ pack.on('file', (name) => { | ||
pack.on('progress', (percent) => { | ||
console.log(percent + '%'); | ||
console.log(`${percent}%`); | ||
}); | ||
@@ -90,3 +86,3 @@ | ||
const name = 'pipe.zip'; | ||
const to = cwd + '/pipe-io'; | ||
const to = `${cwd}/pipe-io`; | ||
const from = path.join(cwd, name); | ||
@@ -105,3 +101,3 @@ | ||
extract.on('progress', (percent) => { | ||
console.log(percent + '%'); | ||
console.log(`${percent}%`); | ||
}); | ||
@@ -139,9 +135,7 @@ | ||
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/node-onezip/master.svg?style=flat | ||
[DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/node-onezip.svg?style=flat | ||
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat | ||
[NPMURL]: https://npmjs.org/package/onezip "npm" | ||
[BuildStatusURL]: https://travis-ci.org/coderaiser/node-onezip "Build Status" | ||
[DependencyStatusURL]: https://david-dm.org/coderaiser/node-onezip "Dependency Status" | ||
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License" | ||
[CoverageURL]: https://coveralls.io/github/coderaiser/node-onezip?branch=master | ||
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/node-onezip/badge.svg?branch=master&service=github |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21157
13
366
137
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
+ Addedyargs-parser@21.1.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyargs-parser@20.2.9(transitive)
Updatedglob@^10.3.10
Updatedyargs-parser@^21.1.1