Create tree-like data structures from multiple SQL queries. Useful for rich API output.
Create data structures from SQL queries, especially useful for building API's
npm install structures
var Structure = require'structures';var myStructure =source: personlistchildren:addresses:source: personaddresseskey: 'person_id'parent_key: 'id'myStructure id: 1234on'done' console.logstructure;on'error' console.logerr;init;
person.list and person.addresses should be functions which return a database query suitable for use with node-postgres / any-db.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2013 Mark Selby
Licensed under the MIT license.