-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
123 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# 0.1.3 | ||
|
||
## Patches | ||
|
||
- Fix incorrect split chunk when process large files. | ||
|
||
# 0.1.2 | ||
|
||
## Patches | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Example | ||
|
||
> [!IMPORTANT] | ||
> This sample example might not support work on windows. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
import zlib from 'zlib' | ||
import { createExtract } from 'tar-mini' | ||
import { setupEnv } from './setup.js' | ||
|
||
const [ok, symPath] = setupEnv() | ||
|
||
async function main() { | ||
if (!ok) { | ||
console.error('An error occurred') | ||
process.exit(1) | ||
} | ||
const extract = createExtract() | ||
const gz = path.join(symPath, 'node-v22.7.0.tar.gz') | ||
const readable = fs.createReadStream(gz) | ||
|
||
const unzip = zlib.createUnzip() | ||
|
||
extract.on('entry', (head) => { | ||
console.log(head.name) | ||
}) | ||
|
||
readable.pipe(unzip).pipe(extract.receiver) | ||
|
||
await new Promise((resolve) => extract.on('close', resolve)) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"private": true, | ||
"type": "module", | ||
"devDependencies": { | ||
"tar-mini": "workspace:*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import fs from 'fs' | ||
import url from 'url' | ||
import path from 'path' | ||
|
||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url)) | ||
|
||
const TARGET_FIXTURES_PATH = path.join(path.dirname(__dirname), '__tests__', 'fixtures') | ||
|
||
const OUTPUT_PATH = path.join(__dirname, 'tpl') | ||
|
||
export function setupEnv() { | ||
if (fs.existsSync(OUTPUT_PATH)) { | ||
return [true, OUTPUT_PATH] | ||
} | ||
|
||
try { | ||
fs.symlinkSync(TARGET_FIXTURES_PATH, OUTPUT_PATH, 'dir') | ||
return [true, OUTPUT_PATH] | ||
} catch (error) { | ||
return [false, ''] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
packages: | ||
- 'example' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters