npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

adonis-rss

v1.0.0

Published

RSS provider for AdonisJS framework

Readme

Adonis RSS Provider

A RSS provider for the Adonis framework. This package uses the rss package by dylang.

This package provides easy access to a RSS generator for Node.

Install

npm install --save adonis-rss
# or
yarn add adonis-rss

Configure

Register this package in bootstrap/app.js

const providers = [
  ...
  'adonis-rss/providers/RssProvider'
]

You can also add an alias for easier access.

const aliases = {
  ...
  Rss: 'Adonis/Addons/Rss'
}

Usage

This package works the same as dylang/node-rss. Take a look at its documentation.

The only addition to original package is an additional prototype to polyfill in the feedOptions.

The provider will give you an empty RSS generator object. This will generate a sample feed. Using Rss.options(feedOptions) you can use a predefined options object holding all the necessary feed options without the need to assign each proptery yourself.

const Rss = use('Rss');


/**
  * Somewhere in a controller
  */
const feedOptions = {
    title: 'title',
    // description: 'description',
    // feed_url: 'http://example.com/rss.xml',
    site_url: 'http://example.com',
    image_url: 'http://example.com/icon.png',
    docs: 'http://example.com/rss/docs.html',
    managingEditor: 'Dylan Greene',
    webMaster: 'Dylan Greene',
    copyright: '2013 Dylan Greene',
    language: 'en',
    categories: ['Category 1','Category 2','Category 3'],
    pubDate: 'May 20, 2012 04:00:00 GMT',
    ttl: '60',
    custom_namespaces: {
        'itunes': 'http://www.itunes.com/dtds/podcast-1.0.dtd'
    },
    custom_elements: [
        {'itunes:subtitle': 'A show about everything'},
        {'itunes:author': 'John Doe'},
        {'itunes:summary': 'All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our podcast in the Podcasts app or in the iTunes Store'},
        {'itunes:owner': [
            {'itunes:name': 'John Doe'},
            {'itunes:email': '[email protected]'}
        ]},
        {'itunes:image': {
            _attr: {
                href: 'http://example.com/podcasts/everything/AllAboutEverything.jpg'
            }
        }},
        {'itunes:category': [
            {_attr: {
                text: 'Technology'
            }},
            {'itunes:category': {
                _attr: {
                    text: 'Gadgets'
                }
            }}
        ]}
    ]
};

/* Assign feed options */
Rss.options(feedOptions);

/* loop over data and add to feed */
Rss.item({
    title:  'item title',
    description: 'use this for the content. It can include html.',
    url: 'http://example.com/article4?this&that', // link to the item
    guid: '1123', // optional - defaults to url
    // categories: ['Category 1','Category 2','Category 3','Category 4'], // optional - array of item categories
    author: 'Guest Author', // optional - defaults to feed author property
    date: 'May 27, 2012', // any format that js Date can parse.
    lat: 33.417974, //optional latitude field for GeoRSS
    long: -111.933231, //optional longitude field for GeoRSS
    // enclosure: {url:'...', file:'path-to-file'}, // optional enclosure
    custom_elements: [
        {'itunes:author': 'John Doe'},
        {'itunes:subtitle': 'A short primer on table spices'},
        {'itunes:image': {
            _attr: {
                href: 'http://example.com/podcasts/everything/AllAboutEverything/Episode1.jpg'
            }
        }},
        {'itunes:duration': '7:04'}
    ]
});

/* Send RSS feed with correct Content-Type back */
response
  .header('Content-type', 'application/rss+xml')
  .send(Rss.xml());

Licenses

Copyright (c) 2016 Hans-Helge Buerger.

Released under the MIT License.

Thanks

Special thanks to the creator(s) of AdonisJS for creating such a great framework. And Dylan Greene for creating node-rss.