
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
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
The npm package rss-api receives a total of 0 weekly downloads. As such, rss-api popularity was classified as not popular.
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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.