How to use @truffle/box - 1 common examples

To help you get started, we’ve selected a few @truffle/box examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trufflesuite / truffle / packages / core / lib / commands / unbox.js View on Github external
const Config = require("@truffle/config");
    const Box = require("@truffle/box");
    const OS = require("os");

    const config = Config.default().with({
      logger: console
    });

    let [url, destination] = normalizeInput(options._[0]);

    url = normalizeURL(url);
    destination = normalizeDestination(destination, config.working_directory);

    const unboxOptions = Object.assign({}, options, { logger: config.logger });

    Box.unbox(url, destination, unboxOptions)
      .then(({ commands }) => {
        config.logger.log(`\nUnbox successful. Sweet!${OS.EOL}`);

        const commandMessages = formatCommands(commands);
        if (commandMessages.length > 0) config.logger.log(`Commands:${OS.EOL}`);

        commandMessages.forEach(message => config.logger.log(message));
        config.logger.log("");

        done();
      })
      .catch(done);
  }
};

@truffle/box

Truffle project boilerplate utility

MIT
Latest version published 8 months ago

Package Health Score

50 / 100
Full package analysis

Popular @truffle/box functions