Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

structures

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

structures

Create tree-like data structures from multiple SQL queries. Useful for rich API output.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

structures Build Status Dependencies Status

Create data structures from SQL queries, especially useful for building API's

Getting Started

Install with: npm install structures

Examples

var Structure = require('structures');

var myStructure = {
  source: person.list,
  children: {
    addresses: {
      source: person.addresses,
      key: 'person_id',
      parent_key: 'id'
    }
  }
}

new Structure(myStructure, { id: 1,2,3,4 })
  .on('done', function (structure) { console.log(structure); })
  .on('error', function (err) { console.log(err); })
  .init();

person.list and person.addresses should be functions which return a database query suitable for use with node-postgres / any-db.

Contributing

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.

Release History

(Nothing yet)

License

Copyright (c) 2013 Mark Selby
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 02 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc