1.0.7 • Published 7 years ago

directory-scan v1.0.7

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

What is this?

This package will take a directory and scan recursively. The result is an array of child directories

Example: say your folder structure is like this

projet root
    |app
        |component
            |action
            |reducer
    |css
    |image
    package.json

directory-scan will get you something like below

[
    'app',
    'app/component',
    'app/component/action',
    'app/component/reducer',
    'css',
    'image'
]

Installation

npm i --save-dev directory-scan

Usage

Basic

import dirScan from 'directory-scan'

dirScan.get('./')

//output 
[
    'app',
    'app/component',
    'app/component/action',
    'app/component/reducer',
    'css',
    'image'
]

./ is to get all folders and sub folders of folders in root directory.

By default this package will automatically exclude node_modules folder and .git folder

Exclude folder from scan

import dirScan from 'directory-scan'

dirScan.get('./', 'css')

//output 
[
    'app',
    'app/component',
    'app/component/action',
    'app/component/reducer',
    'image'
]

This will scan every folders in your root except css folder

import dirScan from 'directory-scan'

dirScan.get('./', ['css','image'])

//output 
[
    'app',
    'app/component',
    'app/component/action',
    'app/component/reducer'
]

This will scan every folders in your root except css and image folder

Test

npm test

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago