
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@sitchco/project-scanner
Advanced tools
A utility class for scanning a Sitchco WordPress project to discover modules, asset entry points, and other key directories based on established conventions.
This package provides a programmatic interface for navigating the project structure. It is the foundational discovery tool used by other build scripts like @sitchco/module-builder
and @sitchco/formatter
to get a reliable list of files and paths to operate on.
It is built on a "convention over configuration" philosophy, meaning it understands the project's layout without needing complex configuration.
The scanner's logic is based on the following directory structure:
modules/
folder is considered a module..js
, .mjs
, .jsx
, .scss
, .css
) in these specific locations:
assets/scripts/
assets/styles/
blocks/
assets/
directory of any block within blocks/
wp-content
, identifying it as the web root.The main export is the ProjectScanner
class.
new ProjectScanner(options?)
Creates a new scanner instance.
import ProjectScanner from '@sitchco/project-scanner';
// Create a scanner instance starting from the current working directory
const scanner = new ProjectScanner();
// Or, create an instance with a specific project root
const scannerWithCustomRoot = new ProjectScanner({
projectRoot: '/path/to/sitchco-core',
});
Options:
projectRoot
(string): The absolute path to the project's root directory. Defaults to process.cwd()
.ignorePatterns
(string[]): An array of glob patterns to ignore during scans.All methods return a Promise
.
.getModuleDirs(): Promise<string[]>
Returns an array of absolute paths to all discovered module directories (e.g., ['.../sitchco-core/modules/Demo']
).
.getEntrypoints(): Promise<string[]>
Returns a flattened array of absolute paths to all discoverable asset entry points across all modules.
.getWebRoot(): Promise<string>
Scans upwards from the project root to find and return the absolute path to the WordPress web root (the directory containing wp-content
).
.findAllSourceFiles(extensions: string[]): Promise<string[]>
Finds all files with the given extensions (e.g., ['.php', '.svg']
) within the entire project, respecting ignore patterns.
.findModuleSourceFiles(extensions: string[]): Promise<string[]>
Similar to findAllSourceFiles
, but scopes the search to only the discovered module directories.
.cleanBuildArtifacts(): Promise<void>
Finds and removes the build artifact directory (dist/
) within the project.
.clearCache(): void
Clears the internal cache for module directories, entry points, and the web root, forcing a fresh scan on the next method call.
FAQs
Scans project structure for Sitchco modules and assets
The npm package @sitchco/project-scanner receives a total of 18 weekly downloads. As such, @sitchco/project-scanner popularity was classified as not popular.
We found that @sitchco/project-scanner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.