truffle exec <script.js>

Execute a JS module within the Truffle environment

Arguments

NameDescription
script.jsJavaScript file to be executed. Can include path information if the script does not exist in the current directory. (required)

Options

NameDescription
--network <name>Specify the network to use, using artifacts specific to that network
--compileCompile contracts before executing the script