json-transmogrify
Small lib to aid in getting data from transforming data from a json file or url into xml.
Last updated 4 years ago by hairmare .
GPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install json-transmogrify 
SYNC missed versions from official npm registry.

JSON Transmogrify

A simple lib for transforming json data into xml using jsonpath-object-transform and js2xmlparser.

Install

npm install json-transmogrify --save

Usage

var transmogrify = require('json-transmogrify');

var source = './file.json'; // may be a file path, an URL or a javascript object

var options = {
  // root node of target xml
  root: 'xmlRoot',
  // jsonpath-object-transform
  template: {
    id: "$.id"
  },
  // method to mangle raw results from request or file
  postRequest: function(data) { return data; },
  // method to mangle results of jsonpath-object-transform, may return a promise or data
  postTransform: function(data) { return data; },
}

transmogrify(source, options)
  .then(function(data) {
    console.log(data);
  });

Current Tags

  • 0.4.0                                ...           latest (3 years ago)

5 Versions

  • 0.4.0                                ...           3 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (4)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |