New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fs-ls-r

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-ls-r

A simple recursive file lister

latest
Source
npmnpm
Version
1.2.10
Version published
Maintainers
1
Created
Source

fs-ls-r

Build codecov

A simple recursive file lister for node.

Install

npm i fs-ls-r

Usage

See the tests!

const fs = require('fs-ls-r');

// Make a directory parser
const dp = new fs.DirectoryParser();

// Parse recursively to get the files in the directory './foo'
const files = dp.parse('./foo');

// files is an array of files...
// Each file has a name, extension and full path
// e.g.
console.log(files[0].name); // 'hello.txt'
console.log(files[0].extension); // '.txt'
console.log(files[0].fullPath); // './foo/bar/hello.txt'

We can restrict to certain file types

const files = dp.parse('./foo', ['.cs', '.cpp']); // just .cs and .cpp files

We can exclude results based on keywords (case insensitive)

const files = dp.parse('./foo', undefined, ['bin', 'debug']); // ignore files with paths containing 'bin' or 'debug'

Or do a mixture

const files = dp.parse('./foo', ['.cs'], ['bin', 'debug']);

Keywords

fs

FAQs

Package last updated on 12 Dec 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