LocalMachinepacks.parseMachinepackMetadata()

Parse machinepack data from the provided JSON string.

The provided JSON string will likely come from a package.json entry; whether it comes from the local filesystem, NPM, or elsewhere.

Usage

Hover over inputs/exits for more info.

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


// Parse machinepack data from the provided JSON string.

LocalMachinepacks.parseMachinepackMetadata({

json: '{...package.json string...}',

}).execSync();

Inputs

json required

The package.json object for the NPM package.

'{...package.json string...}'

Exits

error

An unexpected error occurred.

notMachinepack

The provided package.json data is valid, but not 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' }