# feedparser-promised

> Wrapper around feedparser with promises

Latest version **2.0.1** (published 2019-06-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install feedparser-promised
pnpm add feedparser-promised
yarn add feedparser-promised
bun add feedparser-promised
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-06-07 |
| First published | 2015-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Alabe Duarte |
| Maintainers | alabeduarte |
| Keywords | feed, rss, node, nodejs, javascript, parser, promise |

## Links

- npm: https://www.npmjs.com/package/feedparser-promised
- Repository: https://github.com/alabeduarte/feedparser-promised
- Homepage: https://github.com/alabeduarte/feedparser-promised#readme
- Issues: https://github.com/alabeduarte/feedparser-promised/issues
- npm.io page: https://npm.io/package/feedparser-promised

## Dependencies (4)

- [request](https://npm.io/package/request.md) 2.88.0
- [feedparser](https://npm.io/package/feedparser.md) 2.2.9
- [@types/request](https://npm.io/package/@types/request.md) 2.48.1
- [@types/feedparser](https://npm.io/package/@types/feedparser.md) 2.2.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2019-06-07
- 2.0.0 — 2018-09-23
- 1.5.0 — 2017-12-22
- 1.4.2 — 2017-08-21
- 1.4.1 — 2017-08-21
- 1.4.0 — 2017-08-09
- 1.3.0 — 2017-06-14
- 1.2.2 — 2017-05-03
- 1.2.1 — 2017-03-02
- 1.2.0 — 2017-03-02
- 1.1.3 — 2017-03-02
- 1.1.2 — 2017-03-01
- 1.1.1 — 2016-07-29
- 1.1.0 — 2016-07-28
- 1.0.4 — 2016-05-30
- … 8 more at https://npm.io/package/feedparser-promised/versions

## README

# feedparser-promised

[![npm version](https://img.shields.io/npm/v/feedparser-promised.svg)](https://www.npmjs.com/package/feedparser-promised)
[![downloads](https://img.shields.io/npm/dm/feedparser-promised.svg)](https://www.npmjs.com/package/feedparser-promised)
[![npm license](https://img.shields.io/npm/l/feedparser-promised.svg)](https://spdx.org/licenses/MIT)
[![travis build](https://img.shields.io/travis/alabeduarte/feedparser-promised.svg)](https://travis-ci.org/alabeduarte/feedparser-promised)
[![codeclimate score](https://img.shields.io/codeclimate/github/alabeduarte/feedparser-promised.svg)](https://codeclimate.com/github/alabeduarte/feedparser-promised)

Wrapper around [feedparser](https://github.com/danmactough/node-feedparser) with promises.

## Install

```
  $ npm install --save feedparser-promised
```

## Usage

```javascript
  const feedparser = require('feedparser-promised');

  const url = 'http://feeds.feedwrench.com/JavaScriptJabber.rss';

  feedparser.parse(url).then(items =>
    items.forEach(item => console.log('title:', item.title));
  ).catch(console.error);
```

## Using [HTTP Node.js](https://nodejs.org/api/http.html#http_http_get_options_callback) options
```javascript
const feedparser = require('feedparser-promised');

const httpOptions = {
  uri: 'http://feeds.feedwrench.com/JavaScriptJabber.rss',
  timeout: 3000,
  gzip: true,
  // ...
};

feedparser.parse(httpOptions).then(items => { /* do your magic here */ });
```

## Using [Feedparser](https://github.com/danmactough/node-feedparser#options) options
```javascript
const feedparser = require('feedparser-promised');

const httpOptions = {
  uri: 'http://feeds.feedwrench.com/JavaScriptJabber.rss',
  // ...
};

const feedparserOptions = {
  feedurl: 'http://feeds.feedwrench.com/JavaScriptJabber.rss',
  normalize: false,
  addmeta: false,
  resume_saxerror: true
};

feedparser.parse(httpOptions, feedparserOptions).then(items => { /* do your magic here */ });
```

### List of article properties

* `title`: title
* `description`: frequently, the full article content
* `summary`: frequently, an excerpt of the article content
* `link`: link
* `origlink`: when FeedBurner or Pheedo puts a special tracking url in the `link` property, `origlink` contains the original link
* `permalink`: when an RSS feed has a `guid` field and the `isPermalink` attribute is not set to `false`, `permalink` contains the value of `guid`
* `date`: most recent update
* `pubdate`: original published date
* `author`: author
* `guid` a unique identifier for the article
* `comments`: a link to the article's comments section
* `image`: `an Object containing `url` and `title` properties
* `categories`: an Array of Strings
* `source`: an Object containing `url` and `title` properties pointing to the original source for an article; see the [RSS Spec](http://cyber.law.harvard.edu/rss/rss.html#ltsourcegtSubelementOfLtitemgt) for an explanation of this element
* `enclosures`: an Array of Objects, each representing a podcast or other enclosure and having a `url` property and possibly `type` and `length` properties
* `meta`: an Object containing all the feed meta properties; especially handy when using the EventEmitter interface to listen to `article` emissions

### Contributing
There are many ways to contribute, such as fixing opened issues, creating them
or suggesting new ideas.
Either way will be very appreciated.

If there are issues open, I recommend you follow those steps:

* Create a branch feedparser-promised#{issue_number}; eg: feedparser-promised#42
* Please, remember to write unit tests.
* Send a pull request!

### Running Tests

```bash
$ npm test
```

## License

`feedparser-promised` is released under the [MIT License](http://www.opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/feedparser-promised · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
