feat: add option to exclude directories from index.js (#50)
* Add option to exclude directories from index.js * Update readDirectory.js * Update writeIndexCli.js * Update readDirectory.js * Update README
This commit is contained in:
committed by
Gajus Kuizinas
parent
1efd1c6c7b
commit
6aac149a8b
@@ -82,21 +82,34 @@ npm install create-index
|
||||
create-index --help
|
||||
|
||||
Options:
|
||||
--recursive, -r Create/update index files recursively. Halts on any unsafe
|
||||
"index.js" files. [boolean] [default: false]
|
||||
--ignoreUnsafe, -i Ignores unsafe "index.js" files instead of halting.
|
||||
--recursive, -r Create/update index files recursively. Halts on any
|
||||
unsafe "index.js" files. [boolean] [default: false]
|
||||
--ignoreUnsafe, -i Ignores unsafe "index.js" files instead of halting.
|
||||
[boolean] [default: false]
|
||||
--update, -u Updates only previously created index files (recursively).
|
||||
--ignoreDirectories, -d Ignores importing directories into the index file,
|
||||
even if they have a safe "index.js".
|
||||
[boolean] [default: false]
|
||||
--banner Add a custom banner at the top of the index file [string]
|
||||
--update, -u Updates only previously created index files
|
||||
(recursively). [boolean] [default: false]
|
||||
--banner Add a custom banner at the top of the index file
|
||||
[string]
|
||||
--extensions, -x Allows some extensions to be parsed as valid source.
|
||||
First extension will always be preferred to homonyms
|
||||
with another allowed extension.
|
||||
[array] [default: ["js"]]
|
||||
|
||||
Examples:
|
||||
create-index ./src ./src/utilities Creates or updates an existing
|
||||
create-index index file in the target
|
||||
(./src, ./src/utilities) directories.
|
||||
create-index --update ./src ./tests Finds all create-index index files in the
|
||||
target directories and descending
|
||||
directories. Updates found index files.
|
||||
create-index ./src ./src/utilities Creates or updates an existing
|
||||
create-index index file in the target
|
||||
(./src, ./src/utilities) directories.
|
||||
create-index --update ./src ./tests Finds all create-index index files in
|
||||
the target directories and descending
|
||||
directories. Updates found index
|
||||
files.
|
||||
create-index ./src --extensions js jsx Creates or updates an existing
|
||||
create-index index file in the target
|
||||
(./src) directory for both .js and
|
||||
.jsx extensions.
|
||||
```
|
||||
|
||||
### Using `create-index` Programmatically
|
||||
|
||||
Reference in New Issue
Block a user