Registry / testing / dekko
library0.7.0jsnpmunverified

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 dekko
INSTALL
IMPORT
SIG · DEKKO
D
dekko
testingjavascriptv0.7.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

$
const $ = require('dekko');
import $ from 'dekko';
Dekko uses CommonJS `require` syntax and does not officially support ESM imports. Given its abandoned status, an ESM version is unlikely.
Dekko object methods
$('path').isDirectory().hasFile('file.js');
dekko('path').isDirectory();
The primary export is a function (`$`) which returns a chainable object. Direct instantiation is not intended.

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.

const $ = require('dekko'); const fs = require('fs'); const path = require('path'); // Create a dummy 'dist' directory for demonstration const distPath = path.join(__dirname, 'dist'); const libJsPath = path.join(distPath, 'lib.js'); const libMinJsPath = path.join(distPath, 'lib.min.js'); if (!fs.existsSync(distPath)) { fs.mkdirSync(distPath); } fs.writeFileSync(libJsPath, '// library code'); fs.writeFileSync(libMinJsPath, '// minified library code'); try { // Assert that 'dist' is a directory and contains specific files $('dist') .isDirectory() .hasFile('lib.js') .hasFile('lib.min.js'); // Demonstrate a custom assertion $('dist/lib.js').assert('lib.js should not be empty', (filename) => { const content = fs.readFileSync(filename, 'utf8'); return content.length > 10; }); console.log('All dekko assertions passed successfully!'); // Clean up dummy directory fs.unlinkSync(libJsPath); fs.unlinkSync(libMinJsPath); fs.rmdirSync(distPath); } catch (error) { console.error('Dekko assertion failed:', error.message); // Clean up dummy directory even if an error occurs if (fs.existsSync(libJsPath)) fs.unlinkSync(libJsPath); if (fs.existsSync(libMinJsPath)) fs.unlinkSync(libMinJsPath); if (fs.existsSync(distPath)) fs.rmdirSync(distPath); process.exit(1); }
Debug
Known issues
breakingDekko is an abandoned package, with its last commit in 2016 and version 0.2.1. It uses CommonJS modules (`require`) exclusively, which is incompatible with modern ESM-only Node.js projects without a transpilation step or specific `type: 'module'` configurations.
fix
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.
affects: >=0.1.0
gotchaBy design, `dekko` throws an error and stops execution if any assertion fails. While useful for CI, this can halt scripts unexpectedly if not properly caught or if assertions are not met.
fix
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.
affects: >=0.1.0
gotchaAs an unmaintained project, `dekko` will not receive updates for security vulnerabilities, bug fixes, or compatibility with newer Node.js versions or file system behaviors. Its dependency `glob` also evolves, and `dekko`'s embedded version or usage might become outdated.
fix
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.
affects: >=0.1.0
Errors
Common errors & fixes
Error: No items matched the pattern: 'non-existent-dir'
The initial `$(pattern)` call did not find any files or directories matching the provided glob pattern.
fix
Ensure the `pattern` argument passed to `$` accurately reflects existing files or directories. Double-check paths and glob syntax.
Error: Item is not a directory: /path/to/some/file.js
The `.isDirectory()` method was called on an item that is a file, not a directory.
fix
Apply `.isDirectory()` only to patterns or items expected to be directories. Use `.isFile()` for files, or adjust your glob pattern to target directories specifically.
Error: Directory does not contain file: expected-file.txt
The `.hasFile(name)` method was called on a directory that does not contain a sub-file with the specified `name`.
fix
Verify that the `name` provided to `.hasFile()` matches an existing file within the target directory. Check for typos or incorrect casing.
Upgrade
Version history
0.7.0latest on npm
Audit
Dependencies
globrequiredUsed internally for pattern matching in the main `$` function.
Agent activity
4 hits · last 30 days
node
4
Resources
dekko — npm install dekko · libregistry