37 GB
4,042,753 files
Updated about 1 month ago
Name
Size
src
tests
CHANGELOG.md2.18 kB
xet
README.md2.26 kB
xet
deno.json386 Bytes
xet
mod.ts455 Bytes
xet
README.md

@zuke/knip

Typed Knip CLI task wrapper for Zuke builds — find unused files, dependencies, and exports.

import { KnipTasks } from "@zuke/knip";

await KnipTasks.run((s) => s.production().strict());

API

Full typed API — generated from deno doc
`@zuke/knip` — a typed `KnipTasks` wrapper for the Knip (https://knip.dev)
CLI (unused files, dependencies, and exports), for use in Zuke builds.

```ts
import { KnipTasks } from "@zuke/knip";

await KnipTasks.run((s) => s.production().strict());
```
@module

const KnipTasks: KnipTasksApi
  Typed task functions for the `knip` CLI.

class KnipRunSettings extends ToolSettings
  Settings for a `knip` run.

  override protected defaultTool(): string
    The underlying CLI command: `knip`.
  override protected defaultResolution(): ToolResolution
    Resolve the binary from `node_modules/.bin` by default — knip is an npm-distributed tool.
  production(): this
    Restrict analysis to production code paths (`--production`).
  strict(): this
    Treat the production set strictly (`--strict`).
  fix(): this
    Auto-remove unused exports/dependencies where possible (`--fix`).
  cache(): this
    Enable the analysis cache (`--cache`).
  noExitCode(): this
    Always exit 0, even when issues are found (`--no-exit-code`).
  config(path: PathLike): this
    Use an explicit config file (`--config`).
  workspace(name: string): this
    Restrict to a single workspace (`--workspace`).
  reporter(name: string): this
    Choose the reporter, e.g. `json` or `compact` (`--reporter`).
  include(...types: string[]): this
    Limit to specific issue types, e.g. `files`, `dependencies` (`--include`).
  override protected onOutput(output: CommandOutput): void
    Report `Issues`, the findings summed over every section, onto the build summary.
  override protected buildArgs(): string[]
    Assemble the `knip <flags>` argv.

interface KnipTasksApi
  The shape of {@link KnipTasks}.

  run(configure?: Configure<KnipRunSettings>): Promise<CommandOutput>
    Find unused files, dependencies, and exports: `knip`.
Total size
37 GB
Files
4,042,753
Last updated
Oct 24
Pre-warmed CDN
US EU US EU

Contributors