Dekko is a utility designed to validate the output file and directory structure of front-end build or compilation processes. It provides a chainable, assertion-based API to programmatically check for the existence of files or directories, and their types, often used as part of continuous integration (CI) pipelines to prevent malformed or missing assets from being deployed. The package's latest version is 0.2.1, last published in 2016. Due to its age and lack of updates, it is considered abandoned. It differentiates itself by offering a concise, fluid API for defining file system expectations, integrating with Node.js's `glob` for pattern matching.
npm install dekkoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `dekko` to verify a build output directory. It creates a mock `dist` folder, asserts its existence and content, then performs a custom assertion on file size, logging success or failure.
For new projects, consider modern alternatives. If using in an existing CJS project, no fix is strictly needed, but be aware of its unmaintained status. For ESM projects, you might need dynamic `import()` or a build step to handle CJS modules.
Wrap `dekko` assertions in a `try...catch` block if you need to handle failures gracefully without stopping the process, or ensure your CI environment expects and acts on non-zero exit codes.
Evaluate the risk of using unmaintained software in your project. If security or future compatibility is a concern, migrate to a actively maintained file system assertion library.
Ensure the `pattern` argument passed to `$` accurately reflects existing files or directories. Double-check paths and glob syntax.
Apply `.isDirectory()` only to patterns or items expected to be directories. Use `.isFile()` for files, or adjust your glob pattern to target directories specifically.
Verify that the `name` provided to `.hasFile()` matches an existing file within the target directory. Check for typos or incorrect casing.