jsonpformat
v1.0.3
Published
A tool format json or string to jsonp
Downloads
3
Readme
jsonpformat
A tool format json or string to jsonp
let jsonpFormat = require('jsonpformat');
let obj = {a:1,b:'test'};
let result = jsonpFormat('jsonp123',obj)
//return --> 'jsonp123({"a":1,"b":"test"})'
//so you can send it when you are using jsonp
//or you can do this job by yourself
let json = JSON.stringify(ojb);
let sameResult = jsonpFormat('jsonp123',json)
//return --> 'jsonp123({"a":1,"b":"test"})'
//the result same as sameResult