Skip to content

Instantly share code, notes, and snippets.

@anotheredward
Created June 22, 2015 22:12
Show Gist options
  • Save anotheredward/aa5111adbae0a01940dd to your computer and use it in GitHub Desktop.
Save anotheredward/aa5111adbae0a01940dd to your computer and use it in GitHub Desktop.
Creates an Ember model body from a loopback json model
var fs = require('fs')
function printFormat(key) {
console.log(key + ": attr('" + model.properties[key].type + "'),")
}
var model = JSON.parse(fs.readFileSync(process.argv[2], {encoding: 'ascii'}))
Object.keys(model.properties).map(printFormat)
@pnw
Copy link

pnw commented Jun 22, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment