LocalMachinepacks.writePack()

Write a machinepack to disk at the specified path using the given metadata.

Usage

Hover over inputs/exits for more info.

var LocalMachinepacks = require('machinepack-localmachinepacks');


// Write a machinepack to disk at the specified path using the given metadata.

LocalMachinepacks.writePack({

destination: '/Users/mikermcneil/machinepack-foo/',

packData: {},

force: true,

ensureMachineDep: true,

mergeDependencies: true,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// A file or folder already exists at the destination path.

alreadyExists: function (result) {

 

},

// OK.

success: function () {

 

},

});

Inputs

destination required

The path to the machinepack (if path is not absolute, will be resolved from the current working directory)

'/Users/mikermcneil/machinepack-foo/'
packData required

The metadata and code for the machinepack and its machines.

{}
force

Whether to force/overwrite files that already exist at the destination

true
ensureMachineDep

Whether or not to add a dependency on `machine` to the generated pack if it doesn't have one. Enabled by default.

true
mergeDependencies

Whether the dependencies in the pack data should merge on top of existing dependencies (if any) instead of overwriting them

true

Exits

error

An unexpected error occurred.

alreadyExists

A file or folder already exists at the destination path.

'/Users/mikermcneil/code/foo'
success

OK.