Skip to content

Function that transforms a JS object in JSON Feed format to RSS XML

License

Notifications You must be signed in to change notification settings

WebOrigami/json-feed-to-rss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This package exports a single function, jsonFeedToRss, which accepts a JavaScript function in JSON Feed format and returns the corresponding RSS XML.

import jsonFeedToRss from "@weborigami/json-feed-to-rss";

const jsonFeed = {
  version: "https://jsonfeed.org/version/1.1",
  title: "pondlife",
  description: "Dispatches from off the grid",
  feed_url: `https://pondlife.netlify.app/feed.json`,
  home_page_url: "https://pondlife.netlify.app",
  items: [
    {
      content_html:
        "So why did I come all the way out here away from everyone? …",
      date_published: "2025-08-13T17:00:00.000Z",
      id: "https://pondlife.netlify.app/posts/2025-08-13.html",
      title: "Solitude",
      url: "https://pondlife.netlify.app/posts/2025-08-13.html",
    },
  ],
};

const xml = jsonFeedToRss(jsonFeed);

An optional second parameter can supply the following options:

  • feed_url: the public URL where the RSS feed lives
  • language: a language tag identifying the language of the feed content

About

Function that transforms a JS object in JSON Feed format to RSS XML

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •