split-file
Advanced tools
+4
-4
| language: node_js | ||
| node_js: | ||
| - "6" | ||
| - "7" | ||
| - "10" | ||
| - "11" | ||
| - 10 | ||
| - 11 | ||
| - node | ||
| - lts/* | ||
| sudo: false |
+3
-3
| { | ||
| "name": "split-file", | ||
| "version": "2.1.2", | ||
| "version": "2.2.0", | ||
| "private": false, | ||
@@ -28,8 +28,8 @@ "description": "Splitting and merging files with NodeJS", | ||
| "dependencies": { | ||
| "bluebird": "^3.7.0" | ||
| "bluebird": "^3.7.2" | ||
| }, | ||
| "devDependencies": { | ||
| "jest": "^24.9.0", | ||
| "mocha": "^6.2.1" | ||
| "mocha": "^6.2.2" | ||
| } | ||
| } |
+4
-0
@@ -106,2 +106,3 @@ # Split File | ||
| Usage: split-file -s input.bin 5 | ||
| split-file -x input.bin 457000 | ||
| split-file -m output.bin part1 part2 ... | ||
@@ -112,2 +113,5 @@ | ||
| -x <input> <max_size> | ||
| Split the input file into multiple parts with file size maximum of max_size bytes | ||
| -m <output> <part> <part> ... | ||
@@ -114,0 +118,0 @@ Merge the given parts into the output file. |
+19
-0
@@ -20,2 +20,4 @@ #!/usr/bin/env node | ||
| break; | ||
| case '-x': | ||
| this.method = this.splitFileBySize | ||
| default: | ||
@@ -33,2 +35,3 @@ this.method = this.help; | ||
| console.log("Usage: split-file -s input.bin 5"); | ||
| console.log(" split-file -x input.bin 457000"); | ||
| console.log(" split-file -m output.bin part1 part2 ..."); | ||
@@ -39,2 +42,5 @@ console.log(""); | ||
| console.log(""); | ||
| console.log(" -x <input> <max_size>"); | ||
| console.log(" Split the input file into multiple parts with file size maximum of max_size bytes"); | ||
| console.log(""); | ||
| console.log(" -m <output> <part> <part> ..."); | ||
@@ -67,2 +73,15 @@ console.log(" Merge the given parts into the output file."); | ||
| Cli.prototype.splitFileBySize = function() { | ||
| var file = process.argv[3]; | ||
| var max_size = parseInt(process.argv[4]); | ||
| if (isNaN(max_size)) { | ||
| return this.help(); | ||
| } | ||
| split.splitFileBySize(file, max_size).then(function (names) { | ||
| console.log('Successfully splitted into: ' + names); | ||
| }).catch(function (err) { | ||
| console.log('An error occured:'); | ||
| console.log(err); | ||
| }); | ||
| } | ||
| /** | ||
@@ -69,0 +88,0 @@ * Merge command. |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
13592
6.37%275
7.42%121
3.42%Updated