Gathering detailed insights and metrics for recrawl-sync
Gathering detailed insights and metrics for recrawl-sync
Gathering detailed insights and metrics for recrawl-sync
Gathering detailed insights and metrics for recrawl-sync
npm install recrawl-sync
89.2
Supply Chain
67.1
Quality
74.4
Maintenance
100
Vulnerability
99.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1 Stars
70 Commits
2 Watching
4 Branches
2 Contributors
Updated on 04 Dec 2022
Minified
Minified + Gzipped
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
-30.6%
21,397
Compared to previous day
Last week
-4.4%
149,924
Compared to previous week
Last month
2.6%
653,728
Compared to previous month
Last year
3.5%
9,955,047
Compared to previous year
Collect the descendants of a directory.
1import { recrawl } from 'recrawl' 2 3// Create a crawl function. 4// These are the default options. 5const crawl = recrawl({ 6 only: [], 7 skip: [], 8 deep: true, 9 follow: false, 10}) 11 12// The result is an array when `follow` is false, else an object. 13const files = crawl(root) 14 15// Provide your own array/object. 16crawl(root, files) 17 18// Provide an iterator. 19crawl(root, (file, link) => { 20 // The `file` argument is relative to the root. 21 // The `link` argument is null for non-symlinks. It will be absolute if the target is outside the root. 22})
You can use the crawl()
export if you don't want to reuse the configured crawler.
1import { crawl } from 'recrawl' 2 3crawl(root, { 4 only: [], 5 skip: [], 6 deep: true, 7 follow: false, 8})
only?: (string|RegExp)[]
skip?: (string|RegExp)[]
absolute?: boolean
deep?: boolean
depth?: number
enter?: function
filter?: function
follow?: boolean|number|function
adapter?: FileAdapter
The only
and skip
options should be self-explanatory. Paths matching any of
the only
patterns are good. When only
is an empty array, all paths are good.
Paths matching any of the skip
patterns are bad. When skip
is an empty
array, no paths are bad. The skip
patterns override the only
patterns.
The absolute
option converts matching file paths into their absolute form.
To avoid crawling sub-directories, set deep
to false or depth
to 0. You
should never define both deep
and depth
, because the depth
option implies
deep
when it's greater than zero. If neither deep
nor depth
are defined,
the default depth is infinite.
The enter
option is called whenever a directory is encountered. It's passed
the directory path and the current depth. You may return a falsy value to avoid
crawling a directory.
The filter
option is called whenever a filename is encountered. It's passed
the filename and its basename. You may return a falsy value to skip a filename.
The only
and skip
options are applied before this option is called.
To follow all symlinks, set follow
to true. For greater control, use a
function. It's called whenever a symlink is encountered. You may return a falsy
value to avoid following a symlink. It's passed the symlink path and the current
link depth. If you only need to limit the link depth, you can set follow
to a
number, where zero is equivalent to false.
The adapter
option lets you provide your own filesystem.
only
optionRecrawl has its own take on globbing.
/
), only the basename is matched.1'*.js' // matches 'a.js' and 'a/b.js'
1'a/b' // identical to '**/a/b'
1'/*.js' // matches 'a.js' not 'a/b.js'
1'foo/' // matches 'foo/bar' and 'foo/bar/baz' etc
1'*.jsx?' // matches 'a.js' and 'b.jsx' 2'*.(js|ts)' // matches 'a.js' and 'b.ts'
1'foo/**/bar' // matches 'foo/bar' and 'foo/a/b/c/bar' etc
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More