Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

truffle-box

Package Overview
Dependencies
Maintainers
7
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

truffle-box - npm Package Compare versions

Comparing version 1.0.30 to 1.0.31-ens.0

27

box.js

@@ -10,3 +10,9 @@ const utils = require("./lib/utils");

function parseSandboxOptions(options) {
if (typeof options === "string") {
if (typeof options === "function") {
return {
name: "default",
unsafeCleanup: false,
setGracefulCleanup: false
};
} else if (typeof options === "string") {
// back compatibility for when `options` used to be `name`

@@ -95,3 +101,3 @@ return {

// Cleanup temporary files even when an uncaught exception occurs
sandbox: async options => {
sandbox: (options, callback) => {
const { name, unsafeCleanup, setGracefulCleanup } = parseSandboxOptions(

@@ -101,2 +107,6 @@ options

if (typeof options === "function") {
callback = options;
}
if (setGracefulCleanup) {

@@ -107,8 +117,15 @@ tmp.setGracefulCleanup();

const tmpDir = tmp.dirSync({ unsafeCleanup });
await Box.unbox(
Box.unbox(
`https://github.com/trufflesuite/truffle-init-${name}`,
tmpDir.name,
options
);
return Config.load(path.join(tmpDir.name, "truffle-config.js"), {});
)
.then(() => {
const config = Config.load(
path.join(tmpDir.name, "truffle-config.js"),
{}
);
callback(null, config);
})
.catch(callback);
}

@@ -115,0 +132,0 @@ };

14

lib/config.js

@@ -1,6 +0,8 @@

const fse = require("fs-extra");
var fs = require("fs-extra");
function setDefaults(config = {}) {
const hooks = config.hooks || {};
function setDefaults(config) {
config = config || {};
var hooks = config.hooks || {};
return {

@@ -20,3 +22,3 @@ ignore: config.ignore || [],

function read(path) {
return fse
return fs
.readFile(path)

@@ -29,4 +31,4 @@ .catch(() => "{}")

module.exports = {
read,
setDefaults
read: read,
setDefaults: setDefaults
};
{
"name": "truffle-box",
"version": "1.0.30",
"version": "1.0.31-ens.0",
"description": "Truffle project boilerplate utility",

@@ -29,3 +29,3 @@ "main": "box.js",

"tmp": "0.0.33",
"truffle-config": "^1.1.14",
"truffle-config": "^1.1.15-ens.0",
"vcsurl": "^0.1.1"

@@ -36,3 +36,3 @@ },

},
"gitHead": "c074274b98f14f1a26bfd23a8c791a0d1548868c"
"gitHead": "23d3748cc9b1acd1532c90e471d617e0827f4e56"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc