Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rss-parser

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rss-parser - npm Package Compare versions

Comparing version 3.6.3 to 3.7.0

110

index.d.ts
import { Options } from 'xml2js';
interface Headers
{
declare namespace Parser {
export interface Headers {
readonly Accept: string;
readonly 'User-Agent': string;
}
}
interface CustomFields
{
export interface CustomFields {
readonly feed?: string[];
readonly item?: string[] | string[][];
}
}
interface ParserOptions
{
export interface ParserOptions {
readonly xml2js?: Options;

@@ -22,5 +20,5 @@ readonly headers?: Headers;

readonly customFields?: CustomFields;
}
}
interface Items {
export interface Item {
[key: string]: any;

@@ -36,22 +34,23 @@ link?: string;

contentSnippet?: string;
}
}
interface Output {
export interface Output {
[key: string]: any;
link?: string;
title?: string;
items?: Items[];
items?: Item[];
feedUrl?: string;
description?: string;
itunes?: {
[key: string]: any;
image?: string;
owner?: {
name?: string;
email?: string;
};
author?: string;
summary?: string;
explicit?: string;
[key: string]: any;
image?: string;
owner?: {
name?: string;
email?: string;
};
author?: string;
summary?: string;
explicit?: string;
};
}
}

@@ -62,33 +61,40 @@

*/
declare const Parser: {
/**
* @param options - Parser options.
*/
new(options?: ParserOptions): {
/**
* Parse XML content to JSON.
*
* @param xml - The xml to be parsed.
* @param callback - Traditional callback.
*
* @returns Promise that has the same Output as the callback.
*/
parseString(xml: string, callback?: (err: Error, feed: Output) => void): Promise<Output>;
declare class Parser {
/**
* @param options - Parser options.
*/
constructor(options?: Parser.ParserOptions);
/**
* Parse XML content to JSON.
*
* @param xml - The xml to be parsed.
* @param callback - Traditional callback.
*
* @returns Promise that has the same Output as the callback.
*/
parseString(
xml: string,
callback?: (err: Error, feed: Parser.Output) => void
): Promise<Parser.Output>;
/**
* Parse URL content to JSON.
*
* @param feedUrl - The url that needs to be parsed to JSON.
* @param callback - Traditional callback.
* @param redirectCount - Max of redirects, default is set to five.
*
* @example
* await parseURL('https://www.reddit.com/.rss');
* parseURL('https://www.reddit.com/.rss', (err, feed) => { ... });
*
* @returns Promise that has the same Output as the callback.
*/
parseURL(feedUrl: string, callback?: (err: Error, feed: Output) => void, redirectCount?: number): Promise<Output>;
};
/**
* Parse URL content to JSON.
*
* @param feedUrl - The url that needs to be parsed to JSON.
* @param callback - Traditional callback.
* @param redirectCount - Max of redirects, default is set to five.
*
* @example
* await parseURL('https://www.reddit.com/.rss');
* parseURL('https://www.reddit.com/.rss', (err, feed) => { ... });
*
* @returns Promise that has the same Output as the callback.
*/
parseURL(
feedUrl: string,
callback?: (err: Error, feed: Parser.Output) => void,
redirectCount?: number
): Promise<Parser.Output>;
}
export = Parser
export = Parser;
{
"name": "rss-parser",
"version": "3.6.3",
"version": "3.7.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "types": "index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc