
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
split-file
Advanced tools
Split and merge file in multiple parts. Splittable with number of parts or maximum bytes per part
This section contains information on how to use the split-file module in your code.
You can install and save an entry to your package.json with the following command:
npm i --save split-file
All methods return a Promise (bluebird) which results in some respose if some.
splitFile(file) => Promise<string[]>
Consumes:
Produces:
Example:
const splitFile = require('split-file');
splitFile.splitFile(__dirname + '/testfile.bin', 3)
.then((names) => {
console.log(names);
})
.catch((err) => {
console.log('Error: ', err);
});
splitFileBySize(file, maxSize) => Promise<string[]>
Consumes:
Produces:
Example:
const splitFile = require('split-file');
splitFile.splitFileBySize(__dirname + '/testfile.bin', 457000)
.then((names) => {
console.log(names);
})
.catch((err) => {
console.log('Error: ', err);
});
mergeFiles(names, outputFile) => Promise<>
Consumes:
Produces:
Example:
const splitFile = require('split-file');
splitFile.mergeFiles(names, __dirname + '/testfile-output.bin')
.then(() => {
console.log('Done!');
})
.catch((err) => {
console.log('Error: ', err);
});
To use the module from the commandline you can install this package in your global context:
npm i -g split-file
Some situations you need admin rights (sudo or windows run as admin)
The CLI tool works like you use it in your own package.
Usage: split-file -s input.bin 5
split-file -x input.bin 457000
split-file -m output.bin part1 part2 ...
-s <input> <num_parts>
Split the input file in the number of parts given.
-x <input> <max_size>
Split the input file into multiple parts with file size maximum of max_size bytes
-m <output> <part> <part> ...
Merge the given parts into the output file.
License is MIT, see LICENSE
FAQs
Splitting and merging files with NodeJS
The npm package split-file receives a total of 32,600 weekly downloads. As such, split-file popularity was classified as popular.
We found that split-file demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.