LocalMachinepacks.readPackageJson()

Read and parse the package.json file of a local pack in the specified directory.

Usage

Hover over inputs/exits for more info.

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


// Read and parse the package.json file of a local pack in the specified directory.

LocalMachinepacks.readPackageJson({

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

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// The specified path is not the root directory of a machinepack

notMachinepack: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

dir required

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

'/Users/mikermcneil/machinepack-foo/'

Exits

error

An unexpected error occurred.

notMachinepack

The specified path is not the root directory of a machinepack

success

OK.

{ npmPackageName: 'machinepack-facebook',
  identity: 'machinepack-facebook',
  friendlyName: 'Facebook',
  variableName: 'Facebook',
  description: 'asg',
  extendedDescription: 'blah blah',
  moreInfoUrl: 'http://machinepack-facebook.org',
  iconSrc: 'http://machinepack-facebook.org/icon.png',
  version: '0.1.1',
  keywords: [ 'machine' ],
  latestVersionPublishedAt: '2015-01-19T22:26:54.588Z',
  author: 'Marty McFly <marty@mcfly.com>',
  nodeMachineUrl: 'http://node-machine.org/machinepack-foo',
  docsUrl: 'http://node-machine.org/machinepack-foo',
  npmUrl: 'http://npmjs.org/package/machinepack-foo',
  sourceUrl: 'https://github.com/baz/machinepack-foo',
  githubUrl: 'https://github.com/baz/machinepack-foo',
  testsUrl: 'https://travis-ci.org/baz/machinepack-foo',
  machineDir: 'machines/',
  machines: [ 'do-a-thing' ],
  contributors: [ { name: 'Doc Brown', email: 'doc@brown.com' } ],
  dependencies: [ { name: 'lodash', semverRange: '^2.4.1' } ],
  machineDependencies: [ { name: 'lodash', semverRange: '^2.4.1' } ],
  license: 'MIT' }