Installations
npm install recrawl
Score
76.1
Supply Chain
99
Quality
75.5
Maintenance
100
Vulnerability
100
License
Developer
aleclarson
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
14.13.1
NPM Version
7.10.0
Statistics
1 Stars
70 Commits
2 Watching
4 Branches
2 Contributors
Updated on 04 Dec 2022
Bundle Size
10.01 kB
Minified
3.75 kB
Minified + Gzipped
Languages
TypeScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
708,683
Last day
-73%
128
Compared to previous day
Last week
-39.1%
1,336
Compared to previous week
Last month
-6.8%
10,032
Compared to previous month
Last year
-66.4%
92,464
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
recrawl
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})
Options
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.
Gotchas
- Directory symlinks are treated the same as real directories
- Directories are not affected by the
only
option
Pattern syntax
Recrawl has its own take on globbing.
- When a path has no separators (
/
), only the basename is matched.
1'*.js' // matches 'a.js' and 'a/b.js'
- Recursivity is implicit.
1'a/b' // identical to '**/a/b'
- Use a leading separator to match against the root.
1'/*.js' // matches 'a.js' not 'a/b.js'
- Use a trailing separator to match all descendants.
1'foo/' // matches 'foo/bar' and 'foo/bar/baz' etc
- Regular expression syntax is supported. (except dot-all)
1'*.jsx?' // matches 'a.js' and 'b.jsx' 2'*.(js|ts)' // matches 'a.js' and 'b.ts'
- Recursive globbing is supported.
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Info: no jobLevel write permissions found
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
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
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/aleclarson/recrawl/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/aleclarson/recrawl/release.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/aleclarson/recrawl/release.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
45 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-29xr-v42j-r956
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.5
/10
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 MoreOther packages similar to recrawl
recrawl-sync
[![npm](https://img.shields.io/npm/v/recrawl-sync.svg)](https://www.npmjs.com/package/recrawl-sync) [![ci](https://github.com/aleclarson/recrawl/actions/workflows/release.yml/badge.svg)](https://github.com/aleclarson/recrawl/actions/workflows/release.yml)
submit-sitemap
Submits/pings a sitemap file to Google and Bing to encourage them to recrawl your site.
@chuyik/build-if-changed
Run build scripts only when files changed
@alloc/build-if-changed
Run build scripts only when files changed