New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-opml-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opml-parser

Parse OPML lists of podcasts

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-56%
Maintainers
1
Weekly downloads
 
Created
Source

node-opml-parser

Parses an OPML feed into flat list of items.

Output format

Each item in the OPML feed is added to an array

[
  {
    "title": "<Feed title>",
    "url": "<Feed url>",
    "feedUrl": "<Feed feed url>",
    "feedType": "<Feed type, rss or similar>"
  }
]

Installation

npm install --save node-opml-parser

Usage

const parseOpml = require('node-opml-parser');

parsePodcast('<opml xml>', (err, items) => {
  if (err) {
    console.error(err);
    return;
  }

  // items is a flat array of all items in opml
  console.log(items);
});

Test

npm run test

Coverage

npm run cover

Duplicates

In case duplicates are found they are removed. The matching is done based on feed url so anything else can differ.

Folders

OPML can contain a directory structure but it is ignored here; a flat structure is always returned back.

Titles

In case multiple inconsistent titles are found only one is picked.

Precedence:

  1. title
  2. text
  3. description

Additional notes

The parser just tries to find items quite aggressively so it doesn't care too much about structure. This means an incorrectly formatted OPML feed might still contain items, make sure the input is not too broken.

This should not be used to validate OPML feeds!

Blogs vs podcasts

OPML doesn't distinguish between feeds for blogs or podcasts so there's not really a way to know without downloading the feed url and looking for enclosures. This module doesn't make any effort trying to separate what's what.

Keywords

FAQs

Package last updated on 04 Feb 2016

Did you know?

Socket

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.

Install

Related posts

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