node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

sample-schema

sample-schema

Produce a schema from multiple objects over time.

Installation

$ npm install sample-schema

Example

var Sampler = require('sample-schema');
var sampler = new Sampler;
 
sampler.add({ foo: 123 });
sampler.add({ foo: 123, bar: 123 });
sampler.add({ baz: 123, something: 'here' });

yields:

{
  foo: 'float',
  bar: 'float',
  baz: 'float',
  something: 'varchar(2048)'
}

License

MIT