{"action":"created","issue":{"url":"https://api.github.com/repos/flatiron/prompt/issues/93","repository_url":"https://api.github.com/repos/flatiron/prompt","labels_url":"https://api.github.com/repos/flatiron/prompt/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/flatiron/prompt/issues/93/comments","events_url":"https://api.github.com/repos/flatiron/prompt/issues/93/events","html_url":"https://github.com/flatiron/prompt/issues/93","id":37033759,"number":93,"title":"order of prompt?","user":{"login":"greggman","id":234804,"avatar_url":"https://avatars.githubusercontent.com/u/234804?v=3","gravatar_id":"","url":"https://api.github.com/users/greggman","html_url":"https://github.com/greggman","followers_url":"https://api.github.com/users/greggman/followers","following_url":"https://api.github.com/users/greggman/following{/other_user}","gists_url":"https://api.github.com/users/greggman/gists{/gist_id}","starred_url":"https://api.github.com/users/greggman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greggman/subscriptions","organizations_url":"https://api.github.com/users/greggman/orgs","repos_url":"https://api.github.com/users/greggman/repos","events_url":"https://api.github.com/users/greggman/events{/privacy}","received_events_url":"https://api.github.com/users/greggman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-07-02T23:15:51Z","updated_at":"2016-02-04T01:09:24Z","closed_at":"2016-02-04T01:09:24Z","body":"The example in the readme\r\n\r\n```\r\n  var schema = {\r\n    properties: {\r\n      name: {\r\n        pattern: /^[a-zA-Z\\s\\-]+$/,\r\n        message: 'Name must be only letters, spaces, or dashes',\r\n        required: true\r\n      },\r\n      password: {\r\n        hidden: true\r\n      }\r\n    }\r\n  };\r\n\r\n  //\r\n  // Start the prompt\r\n  //\r\n  prompt.start();\r\n\r\n  //\r\n  // Get two properties from the user: email, password\r\n  //\r\n  prompt.get(schema, function (err, result) {\r\n    //\r\n    // Log the results.\r\n    //\r\n    console.log('Command-line input received:');\r\n    console.log('  name: ' + result.name);\r\n    console.log('  password: ' + result.password);\r\n  });\r\n\r\n```\r\nclaims this output\r\n```\r\n  $ node examples/property-prompt.js\r\n  prompt: name: nodejitsu000\r\n  error:  Invalid input for name\r\n  error:  Name must be only letters, spaces, or dashes\r\n  prompt: name: Nodejitsu Inc\r\n  prompt: password:\r\n  Command-line input received:\r\n    name: Nodejitsu Inc\r\n    password: some-password\r\n```\r\n\r\nBut [object property order is not guaranteed in JavaScript](http://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order). \r\n\r\nHow do you know the name will be asked before the password?"},"comment":{"url":"https://api.github.com/repos/flatiron/prompt/issues/comments/179559616","html_url":"https://github.com/flatiron/prompt/issues/93#issuecomment-179559616","issue_url":"https://api.github.com/repos/flatiron/prompt/issues/93","id":179559616,"user":{"login":"gangstead","id":527760,"avatar_url":"https://avatars.githubusercontent.com/u/527760?v=3","gravatar_id":"","url":"https://api.github.com/users/gangstead","html_url":"https://github.com/gangstead","followers_url":"https://api.github.com/users/gangstead/followers","following_url":"https://api.github.com/users/gangstead/following{/other_user}","gists_url":"https://api.github.com/users/gangstead/gists{/gist_id}","starred_url":"https://api.github.com/users/gangstead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gangstead/subscriptions","organizations_url":"https://api.github.com/users/gangstead/orgs","repos_url":"https://api.github.com/users/gangstead/repos","events_url":"https://api.github.com/users/gangstead/events{/privacy}","received_events_url":"https://api.github.com/users/gangstead/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T01:09:24Z","updated_at":"2016-02-04T01:09:24Z","body":"If the order is important pass in an array of properties to the schema."}}