json-diet

0.1.9 • Public • Published

json-diet

Travis

skeletonize your json object

returns last elements type

use in node-js

npm install json-diet

usage

var diet=require("json-diet");

supports AMD

  require(["json-diet"],function(diet){
  });

wild web is support

  <script src="json-diet.js"></script>

USAGE

diet({
  "do": "doe a deer a female deer",
  "re": "a drop of golden sun",
  "me":{
    "name": "I call my self"
  },
  "fa": "a long long way to run",
  "so": {
    "needle": {
      "pulling": 0,
      "thread": "~"
    }
  },
  "la": "a note to follow sew",
  "ti": {
    "drink": {
      "with": ["jam", "bread"]
    }
  }
}).result();

USAGE RESULT

{
  do: 'string',
  re: 'string',
  me: { name: 'string' },
  fa: 'string',
  so: { needle: { pulling: 'number', thread: 'string' } },
  la: 'string',
  ti: { drink: { with: 'array' } }
}

LICENSE

MIT

Package Sidebar

Install

npm i json-diet

Weekly Downloads

5

Version

0.1.9

License

MIT

Last publish

Collaborators

  • flrngel