New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

readline-specific

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

readline-specific

Node module for read specific line from a file

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
46
-67.83%
Maintainers
1
Weekly downloads
 
Created
Source

readline-specific

Node.js module for read specific line from a file. You just need to define your files' path and line number to read (line started from 1). Install it with npm install readline-specific Just require var rl = require('readline-specific')

How to use

rl.readLine(path,row,callback) It will read specific line, if not exist it will emit empty string. You need to define your path, then define line that you want to read.

rl.oneline('./testfile', 1, function(err, res) {
  if (err) console.error(err)	//handling error
  console.log(res)	//print content
})

Next Development

rl.readLines(path,rows,callback) It will read specific lines, and emit an array, if not exist it will contain empty string value. You need to define your path, then define lines that you want to read in array (sorted or unsorted).

rl.multilines('./testfile', [1,4], function(err, res) {
  if (err) console.error(err)	//handling error
  console.log(res)	//print content
})

Keywords

readline

FAQs

Package last updated on 07 May 2015

Related posts