Socket
Book a DemoInstallSign in
Socket

workspace-sieve

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workspace-sieve

A flexible workspace package filter for monorepos

latest
Source
npmnpm
Version
0.3.2
Version published
Maintainers
1
Created
Source

Workspace Sieve

Filter packages in your monorepo

Install

yarn add workspace-sieve

Usage

import { filterWorkspacePackagesFromDirectory } from 'workspace-sieve'

interface FilterOptions {
  patterns: string[] // patterns mean the workspaces you need to match
  filter?: string[] // filter means the packages that need be filtered out in the workplace (based on the patterns matched result)
  experimental?: { debug: boolean }
}

filterWorkspacePackagesFromDirectory(process.cwd(), {
  patterns: ['*', '**']
})

API's

export declare function filterWorkspacePackagesFromDirectory(
  workspaceRoot: string,
  options?: FilterOptions
): Promise<FilterWorkspacePackagesFromDirectoryResult>

export declare function filterWorkspacePackagesByGraphics(
  packageGraph: Record<string, Package>,
  patterns: string[],
  options?: { experimental?: { debug: boolean } }
): FilterWorkspaceResult

export declare function searchForPackageRoot(current: string, root?: string): string

export declare function searchForWorkspaceRoot(current: string, root?: string): string

Sponsors

Tips

  • The implementation result is not consistent with pnpm filter (Not support filter selector for now!!!) Maybe needed if yijie want~
  • filterWorkspacePackagesFromDirectory filter follow the pattern syntax not using selector.

LICENSE

MIT

FAQs

Package last updated on 09 Apr 2025

Did you know?

Socket

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.

Install

Related posts