feed

Feed is a RSS and Atom feed generator for Node.js, making content syndication simple, intuitive and performant!

npm install feed
20 downloads in the last day
56 downloads in the last week
233 downloads in the last month

Feed for Node.js

Feed is a RSS 2.0 and Atom 1.0 generator for Node.js, making content syndication simple, intuitive and performant!

Installation

$ npm install feed

Features

  • Pure JavaScript
  • Support for Atom 1.0 and RSS 2.0
  • Lightweight - Only 1 dependency!

Quick Start

First, add the module:

var Feed = require('feed');

Insert feed-specific information:

var feed = new Feed({
    title:          'Feed Title',
    description:    'This is my personnal feed!',
    link:           'http://example.com/',
    image:          'http://example.com/image.png',
    copyright:      'All rights reserved 2013, John Doe',

    author: {
        name:       'John Doe',
        email:      'johndoe@example.com',
        link:       'https://example.com/johndoe'
    }
});

Insert items using the item function:

for(var key in posts) {
    feed.item({
        title:          posts[key].title,
        link:           posts[key].url,
        description:    posts[key].description,
        author: [
            {
                name:   'Jane Doe',
                email:  'janedoe@example.com',
                link:   'https://example.com/janedoe'
            },
            {
                name:   'Joe Smith',
                email:  'joesmith@example.com',
                link:   'https://example.com/joesmith'
            }
        ],
        contributor: [
            {
                name:   'Shawn Kemp',
                email:  'shawnkemp@example.com',
                link:   'https://example.com/shawnkemp'
            },
            {
                name:   'Reggie Miller',
                email:  'reggiemiller@example.com',
                link:   'https://example.com/reggiemiller'
            }
        ],
        date:           posts[key].date,
        image:          posts[key].image
    });
}

Insert categories using:

feed.addCategory('Technologie');

Insert contributors using:

feed.addContributor({
    name:   'Johan Cruyff',
    email:  'johancruyff@example.com',
    link:   'https://example.com/johancruyff'
});

Output a RSS 2.0 feed:

feed.render('rss-2.0');

Output an Atom 1.0 feed:

feed.render('atom-1.0');

Yes, it's that simple :)!

More Information

License

Copyright (C) 2013, Jean-Philippe Monette contact@jpmonette.net

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

npm loves you