Nodular Pudding Multiverse
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    json-fieldspublic

    json-fields

    Build status

    JSON.parse and JSON.stringify for certain properties of an object

    install

    $ npm install json-fields
    

    example

    JSON.parse some fields of an object:

    var jsonfields = require('json-fields');
     
    var obj = {
      'x-json-user':'{"name":"bob"}',
      'x-json-thing':'{"apple":"green"}',
      'normalfield':'{"a":10}'
    }
     
    var parsedobj = jsonfields.parse(obj, 'x-json');

    JSON.stringify some fields of an object:

    var jsonfields = require('json-fields');
     
    var obj = {
      'x-json-user':{
        name:'bob'
      },
      'x-json-thing':{
        apple:'green'
      },
      'normalfield':'{"a":10}'
    }
     
    var stringobj = jsonfields.stringify(obj, 'x-json');

    licence

    MIT

    Keywords

    none

    install

    npm i json-fields

    Downloadsweekly downloads

    2

    version

    0.0.0

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar