https://github.com/codeocelot/tshirt
Fit a one-size-fits-all tshirt over your data.
https://github.com/codeocelot/tshirt
Last synced: about 2 months ago
JSON representation
Fit a one-size-fits-all tshirt over your data.
- Host: GitHub
- URL: https://github.com/codeocelot/tshirt
- Owner: codeocelot
- Created: 2016-02-15T00:19:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-15T01:57:01.000Z (about 10 years ago)
- Last Synced: 2025-10-05T01:28:50.193Z (6 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#tshirt
## How to use
var tshirt = require('tshirt');
var data = [
{a:1},
{a:'one',b:4,c:{},d:[]},
{a:{},b:42},
{a:[]}
]
var shape = tshirt(data);
console.log(shape);
/*
{
a: Set { 'number', 'string', 'object', 'array' },
b: Set { 'number', 'optional' },
c: Set { 'object', 'optional' },
d: Set { 'array', 'optional' }
}
*/
## Use case inspiration
It sucks opening a 500mb list of objects and manually enumerate the data types for each property. Tshirt solves this by determining the shape of your documents.
## Improvements
Support nested properties.