@truffle-types/artifacts-export-generator
v0.1.8
Published
Generates artifacts.ts file by including only provided artifacts (or excluded by a pattern)
Downloads
40
Readme
Artifacts contents exporter
Generates typescript contents file with exported members from provided folder.
Usage
yarn add -D @truffle-types/artifacts-export-generator
npm install @truffle-types/artifacts-export-generator
JavaScript/Typescript
import { generateArtifactExports } from "@truffle-types/artifacts-export-generator";
const artifactsDir = "./build/contacts";
const exportContentsFile = "./src/artifacts.ts";
const EXCLUDE_PATTERN = "!(*.sol)";
generateArtifactExports(artifactsDir, exportContentsFile, EXCLUDE_PATTERN);
Bash
generate-artifacts-content --artifactsDir ./build/contracts --destination ./src/artifacts.ts --exclude "!(*.sol)"
NPX
npx -p @truffle-types/artifacts-export-generator generate-artifacts-content --artifactsDir ./build/contracts --destination ./src/artifacts.ts --exclude "!(*.sol)"