Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
node-delete-partial
Advanced tools
Readme
An easy and simple to use Node module to efficiently remove the first X number of lines from an inputstream. It uses streams, which means it doesn't need to load whole files in memory, so it is way more efficient and fast, as well can work on very large files without filling memory on the hardware.
Learn more about the installation and how to use this package in the updated documentation page.
Type in the following to the command line to install the dependency.
$ npm install --save node-delete-partial
or
$ yarn add node-delete-partial
var { deletePartialStream } = require('node-delete-partial');
var fs = require('fs');
var input = fs.createReadStream(process.cwd() + '/input.txt');
var output = fs.createWriteStream(process.cwd() + '/output.txt');
input
// delete 5 lines from beginning of file
.pipe(deletePartialStream(5))
.pipe(output);
var { deletePartials } = require('node-delete-partial');
var filePath = process.cwd() + '/file.txt';
deletePartials(filePath, { lines: 5 }, function (err) {
if (err) {
console.log(err);
}
console.log('Completed');
});
deletePartialStream(lines)
Name | Type | Required | Description |
---|---|---|---|
lines | number | NO | Delete the number of lines from the beginning of the file. Default is 1 . |
deletePartials(path[, options], callback)
Name | Type | Required | Description |
---|---|---|---|
path | string | YES | File to delete from and update. |
options | Object | NO | See below. |
callback | Function | NO | The callback gets one argument (err) . |
Valid options keys are:
1
.Free and made possible along with costly maintenance and updates by Lue Hang (the author).
Pull requests are welcomed.
Contributors will be posted here.
Not sure where to start, or a beginner? Take a look at the issues page.
MIT © Lue Hang, as found in the LICENSE file.
FAQs
An easy and simple to use Node module to efficiently remove the first X number of lines from an inputstream. It uses streams, which means it doesn't need to load whole files in memory, so it is way more efficient and fast, as well can work on very large f
The npm package node-delete-partial receives a total of 3 weekly downloads. As such, node-delete-partial popularity was classified as not popular.
We found that node-delete-partial demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.