npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-delete-partial

v2.0.0

Published

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

Downloads

9

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.


:open_file_folder: Index

1. Install

2. Large File Usage Example

3. Small File Usage Example

4. API

5. Author

6. Contribute

7. License


:gem: Install

Type in the following to the command line to install the dependency.

$ npm install --save node-delete-partial

or

$ yarn add node-delete-partial

:tada: Large File Usage Example

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);

:tada: Small File Usage Example

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');
});

:nut_and_bolt: API

:large_blue_diamond: deletePartialStream(lines)

Parameters:

Name | Type | Required | Description ------ | ------ | ------ | ------ lines | number | NO | Delete the number of lines from the beginning of the file. Default is 1.

:large_blue_diamond: deletePartials(path[, options], callback)

Parameters:

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:

  • "lines" (number) - Delete the number of lines from the beginning of the file. Default is 1.

:santa: Author

Free and made possible along with costly maintenance and updates by Lue Hang (the author).


:clap: Contribute

Pull requests are welcomed.

:tophat: Contributors

Contributors will be posted here.

:baby: Beginners

Not sure where to start, or a beginner? Take a look at the issues page.

:page_facing_up: License

MIT © Lue Hang, as found in the LICENSE file.