util.filelist
TypeScript icon, indicating that this package has built-in type declarations

0.0.38 • Public • Published

util.filelist

Reads a file list and returns it as an array of values.

build analysis code style: prettier testing NPM

Reads a given file list, stores each line in an array, and returns the array. It ignore blank lines and comments (# character). Each line is delimited by the newline characters.

Installation

This module uses yarn to manage dependencies and run scripts for development.

To install as a development dependency with cli:

$ yarn add --dev util.filelist

To build the app and run all tests:

$ yarn run all

Example Usage

const getFileList = require('util.filelist');
lines = getFileList("file.list");

lines.forEach(function(line) {
    console.log(line);
});

An example of the file.list above would be:

# This is a comment

    line 1

 line 2

This would result in an Array with only two lines (line 1 & line 2). The comment line and the blank line are removed and are not placed in the list. It also trims leading and trailing spaces.

Readme

Keywords

none

Package Sidebar

Install

npm i util.filelist

Weekly Downloads

6

Version

0.0.38

License

MIT

Unpacked Size

5.43 kB

Total Files

6

Last publish

Collaborators

  • jmquigley