1.1.0 • Published 5 years ago

filels v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

filels

Get file-list of a path

Install

$ npm i --save filels

Quick start

const { info } = require('filels');
const path = './';
const option = {
    filters: [
        '*.js',
    ],
    // ignores: [],
};
let pathInfo = info('./');
console.log(pathInfo);

API

const { list, size, info, create } = require('filels');

list

Return only the file-list of the path.

size

Return only the size of the file-list of the path.

info

Return both list and size.

create

create a ListOperator object. see list-op.js

Path Name Filter

The filters and ignores only check the name part of the path.

  • String: as a wildcard string, * and ? are both supported. ex: *.js abc.* data.js* nu?ber.*

  • RegExp

  • Function: (pathName) => boolean