New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

read-lines-riched

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-lines-riched

Easy way to read file lines on two directions: from the beginning to the end and from the end to the beginning.

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Read Lines Riched

Easy way to read file lines on two directions: from the beginning to the end and from the end to the beginning.

Installing

npm install --save read-lines-riched

Running the tests

npm test

Usage with Promise

Reading lines example from the end of the file to the beginning.

const {readLinesEndToStart} = require("read-lines-riched");

let endToStartRL = readLinesEndToStart("./testing_file");

var func = function () {
    endToStartRL.readNextLine().then(line => {
        if (line) {
            console.log(line);
            func()
        }
        else
            endToStartRL.closeReader();
    });
};

func();

Usage with Async Await

Reading lines example from the beginning of the file to the end.

const { readLinesStartToEnd} = require("read-lines-riched");

const startToEndRL = readLinesStartToEnd("./testing_file");

(async function(){
    var line = await startToEndRL.readNextLine();
    while(line)
    {
        console.log(line);
        line = await startToEndRL.readNextLine();
    }

    startToEndRL.closeReader();
})();

Contributing

  1. Fork it on Github https://github.com/Puzzle9900/read-lines-riched
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Copyright (c) 2018 Puzzle9900

Keywords

FAQs

Package last updated on 07 Feb 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc