• Stars
    star
    1,167
  • Rank 40,028 (Top 0.8 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A RSS, Atom and JSON Feed generator for Node.js, making content syndication simple and intuitive! 🚀

Feed for Node.js
Build Status Coverage Status npm version Tested with Jest License: MIT

jpmonette/feed - RSS 2.0, JSON Feed 1.0, and Atom 1.0 generator for Node.js
Making content syndication simple and intuitive!


👩🏻‍💻 Developer Ready: Quickly generate syndication feeds for your Website.

💪🏼 Strongly Typed: Developed using TypeScript / type-safe.

🔒 Tested: Tests & snapshot for each syndication format to avoid regressions.

Getting Started

Installation

$ yarn add feed

Example

import { Feed } from "feed";

const feed = new Feed({
  title: "Feed Title",
  description: "This is my personal feed!",
  id: "http://example.com/",
  link: "http://example.com/",
  language: "en", // optional, used only in RSS 2.0, possible values: http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
  image: "http://example.com/image.png",
  favicon: "http://example.com/favicon.ico",
  copyright: "All rights reserved 2013, John Doe",
  updated: new Date(2013, 6, 14), // optional, default = today
  generator: "awesome", // optional, default = 'Feed for Node.js'
  feedLinks: {
    json: "https://example.com/json",
    atom: "https://example.com/atom"
  },
  author: {
    name: "John Doe",
    email: "[email protected]",
    link: "https://example.com/johndoe"
  }
});

posts.forEach(post => {
  feed.addItem({
    title: post.title,
    id: post.url,
    link: post.url,
    description: post.description,
    content: post.content,
    author: [
      {
        name: "Jane Doe",
        email: "[email protected]",
        link: "https://example.com/janedoe"
      },
      {
        name: "Joe Smith",
        email: "[email protected]",
        link: "https://example.com/joesmith"
      }
    ],
    contributor: [
      {
        name: "Shawn Kemp",
        email: "[email protected]",
        link: "https://example.com/shawnkemp"
      },
      {
        name: "Reggie Miller",
        email: "[email protected]",
        link: "https://example.com/reggiemiller"
      }
    ],
    date: post.date,
    image: post.image
  });
});

feed.addCategory("Technologie");

feed.addContributor({
  name: "Johan Cruyff",
  email: "[email protected]",
  link: "https://example.com/johancruyff"
});

console.log(feed.rss2());
// Output: RSS 2.0

console.log(feed.atom1());
// Output: Atom 1.0

console.log(feed.json1());
// Output: JSON Feed 1.0

Migrating from < 3.0.0

If you are migrating from a version older than 3.0.0, be sure to update your import as we migrated to ES6 named imports.

If your environment supports the ES6 module syntax, you can import as described above:

import { Feed } from "feed";

Otherwise, you can stick with require():

- const Feed = require('feed');
+ const Feed = require('feed').Feed;

More Information

License

Copyright (C) 2013, Jean-Philippe Monette [email protected]

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.

More Repositories

1

q

A Dynamic SOQL Query Builder for the Force.com Platform ☁️
Apex
49
star
2

salesforce-graphql

Bringing the GraphQL query language to Salesforce ☁️
TypeScript
49
star
3

todomvc-mithril

Mithril TodoMVC Example
JavaScript
39
star
4

bscscan-ts

Explore the Binance Smart Chain using TypeScript and JavaScript
TypeScript
22
star
5

force

force is a Go client library for accessing the Salesforce API ☁️
Go
13
star
6

colourlovers

COLOURlovers for Node.js is a connection library for COLOURlovers API, giving you access to an infinite database of colors, palettes, patterns and a lot more provided by COLOURlovers.
JavaScript
11
star
7

apexcov

Generates public Apex test coverage reports for your Force.com open-source projects
Go
11
star
8

react-bulma

🚀 React components for Bulma - the Modern CSS framework
TypeScript
7
star
9

salesforce-queries

A JavaScript SOQL/SOSL Query Builder for the Force.com Platform ☁️
TypeScript
6
star
10

req-ts

A JavaScript client library for accessing the Registre des entreprises du Québec. 🏢🇨🇦
TypeScript
2
star
11

serverless-slack-bot

Sample serverless Slack bot 🤖 using AWS Lambda, API Gateway and Salesforce
TypeScript
2
star
12

df16-troubleshooting-recursive-triggers

Code for demo shown during the Troubleshooting Recursive Triggers session at Dreamforce 2016 ☁️
Apex
1
star
13

jpmonette.github.com

1
star
14

jpmonette

1
star
15

cnet

CNET API for Node.js is a connection library for CNET API, giving you access to data about tech and consumer electronics products such as computers, digital cameras, MP3 players, and TVs, as well as software titles and merchant pricing from CNET Certified Merchants.
JavaScript
1
star