1.0.5 • Published 8 years ago

jsontile v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

jsontile

JsonTile is a util for transform the json format

Install

NPM

$ npm install jsontile

Usages

var jsontile = require('jsontile')
var obj={
	a:1,
	b:[
		{c:"2"},
		{d:"3"}
	]
}
obj=jsontile(obj)
console.log(obj)
//will get { a: 1, 'b.0.c': '2', 'b.0.d': '3' }

Examples

It is useful for deal with http query,just like:

var querystring=require('querystring')
var jsontile = require('jsontile')
var obj={
	a:1,
	b:[
		{c:"2"},
		{d:"3"}
	]
}
var str=querystring.stringify(jsontile(obj))
console.log(str)
//will get 'a=1&b.0.c=2&b.0.d=3'

It is easy to append json info on http get request

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago