hardhat-directory-analysis
v0.1.0
Published
Hardhat plugin for analyzing directory structures and types of solidity code
Downloads
3
Readme
Hardhat Structure Analysis
Hardhat plugin for analyzing directory structures and types of solidity code.
Installation
# Using yarn
yarn add hardhat-directory-analysis
# Using npm
npm i hardhat-directory-analysis
Import the plugin in your hardhat.config.js
:
require("hardhat-directory-analysis");
Or if you are using TypeScript, in your hardhat.config.ts
:
import "hardhat-directory-analysis";
Usage
Directory Structure
This command creates a map of the directory structure with file types.
npx hardhat directory-structure [--input <input dir>] [--output <outpur dir>]
Or you can use directoryStructure
function from the Hardhat Runtime Environment in hardhat.config.js
.
For example,
task("compile", "compile with printing a directory map")
.addOptionalParam(
"input",
"A path of source directory from the project root. By default, 'contracts/'",
"",
types.string
)
.addOptionalParam(
"output",
"A path of output directory from the project root. By default, '<artifacts dir>/directory-analysis/'",
"",
types.string
)
.setAction(async (taskArgs, hre, runSuper) => {
await runSuper();
await hre.directoryStructure(hre, taskArgs);
});
The result is written down as directory-analysis/directory-structure.json
by default.