
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
A series of useful APIs for xml(specially for RSS) and json.
Version : 1.0.2
Author : Shaffer John
$ npm install rss-api
var rss = require('rss-api');
var rss = require('rss-api');
var xml =
'<?xml version="1.0" encoding="UTF-8" ?>'+
'<a test="123">'+
'<b>456</b>'+
'<c>789</c>'+
'</a>';
**Prototype : **
xml2json = function(xml
,callback
)
callback
is NOT necessaryvar json = rss.xml2json(xml);
//output
/*
{
"a": {
"-test": "123", //"-" is a sign of attribution
"b": "456",
"c": "789"
}
}
*/
//You can also use callback, for example:
rss.xml2json(xml, function(json){
console.log(json);
});
**Prototype : **
json2xml = function(json
,isRSS
,callback
)
isRSS
and callback
is NOT necessaryisRSS
is falsevar json = {a:{'-test':"123",b:"456",c:"789"}};
var xml = rss.json2xml(json);
//output
/*
<?xml version="1.0" encoding="UTF-8" ?>
<a test="123">
<b>456</b>
<c>789</c>
</a>
*/
//If you want to generate RSS:
var xml = rss.json2xml(json,true);
//output
/*
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<a test="123">
<b>456</b>
<c>789</c>
</a>
</rss>
*/
//You can also use callback, for example:
rss.json2xml(json, false, function(xml){
console.log(xml);
});
**Prototype : **
requestHTTP = function(url
, callback
)
callback
is necessaryThis function is convenient for debug.
However it is NOT recommended for production environment.
FAQs
A series of useful APIs for xml(specially for RSS) and json
We found that rss-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.