{
  "name": "feedparser",
  "author": {
    "name": "Dan MacTough",
    "email": "danmactough@gmail.com"
  },
  "description": "Robust RSS Atom and RDF feed parsing using sax js",
  "version": "0.16.6",
  "keywords": [
    "rss",
    "feed",
    "atom",
    "rdf",
    "xml",
    "syndication",
    "rsscloud",
    "pubsubhubbub"
  ],
  "homepage": "http://github.com/danmactough/node-feedparser",
  "repository": {
    "type": "git",
    "url": "git://github.com/danmactough/node-feedparser.git"
  },
  "bugs": {
    "url": "http://github.com/danmactough/node-feedparser/issues"
  },
  "main": "./main.js",
  "engines": {
    "node": ">= 0.8.0"
  },
  "dependencies": {
    "sax": "0.5.x",
    "addressparser": "~0.1.3",
    "array-indexofobject": "0.0.1",
    "readable-stream": "1.0.x",
    "resanitize": "~0.3.0"
  },
  "devDependencies": {
    "mocha": "1.x",
    "request": "2.27.x",
    "iconv": "2.0.x"
  },
  "scripts": {
    "test": "./node_modules/mocha/bin/mocha"
  },
  "readme": "[![Build Status](https://secure.travis-ci.org/danmactough/node-feedparser.png?branch=master)](https://travis-ci.org/danmactough/node-feedparser)\n#  Feedparser - Robust RSS, Atom, and RDF feed parsing in Node.js\n\nThis module adds methods for RSS, Atom, and RDF feed parsing in node.js using\nIsaac Schlueter's [sax](https://github.com/isaacs/sax-js) parser.\n\nFeedparser has a couple features you don't usually see:\n\n1. It resolves relative URLs (such as those seen in Tim Bray's \"ongoing\" [feed](http://www.tbray.org/ongoing/ongoing.atom)).\n2. It properly handles XML namespaces (including those in sadistic feeds\nthat define a non-default namespace for the main feed elements).\n\n## Requirements\n\n- [sax](https://github.com/isaacs/sax-js)\n- [addressparser](https://github.com/andris9/addressparser)\n- [resanitize](https://github.com/danmactough/node-resanitize)\n- [array-indexofobject](https://github.com/danmactough/node-array-indexofobject)\n- [readable-stream](https://github.com/isaacs/readable-stream) (only if using Node <= v0.8.x)\n\n## Installation\n\n```bash\nnpm install feedparser\n```\n\n## Changes since v0.15.x\n\n- The libxml-like helper methods have been removed. There is now just one input\ninterface: the stream interface.\n\n- Events:\n\n    - `304`, `response` - removed, as Feedparser no longer fetches urls\n    - `article`, `complete` - removed; use the stream interface\n    - `data` - all readable streams will emit a `data` event, but this puts the\n      stream into \"old\" v0.8-style push streams\n    - `end` - stream behavior dictates that the `end` event will never fire if\n      you don't read any data from the stream; you can kick the Feedparser stream\n      to work like an \"old\" v0.8-style push stream (and get the old `end` event\n      behavior) by calling `.resume()`.\n\n- `SAXErrors` are emitted as `error` events. By default, they are automatically\nresumed. Pass `{ resume_saxerror: false }` as an option if you want to manually\nhandle `SAXErrors` (abort parsing, perhaps).\n\n## Usage\n\nThe easiest way to use feedparser is to just give it a [readable stream](http://nodejs.org/api/stream.html#stream_readable_stream).\nIt will then return a readable object stream.\n\n```js\n\nvar FeedParser = require('feedparser')\n  , request = require('request');\n\nvar req = request('http://somefeedurl.xml')\n  , feedparser = new FeedParser([options]);\n\nreq.on('error', function (error) {\n  // handle any request errors\n});\nreq.on('response', function (res) {\n  var stream = this;\n\n  if (res.statusCode != 200) return this.emit('error', new Error('Bad status code'));\n\n  stream.pipe(feedparser);\n});\n\n\nfeedparser.on('error', function(error) {\n  // always handle errors\n});\nfeedparser.on('readable', function() {\n  // This is where the action is!\n  var stream = this\n    , meta = this.meta // **NOTE** the \"meta\" is always available in the context of the feedparser instance\n    , item;\n\n  while (item = stream.read()) {\n    console.log(item);\n  }\n});\n\n```\n\nI *strongly* encourage you to take a look at the [iconv example](examples/iconv.js)\nfor a very thorough working example.\n\n### options\n\n- `normalize` - Set to `false` to override Feedparser's default behavior,\n  which is to parse feeds into an object that contains the generic properties\n  patterned after (although not identical to) the RSS 2.0 format, regardless\n  of the feed's format.\n\n- `addmeta` - Set to `false` to override Feedparser's default behavior, which\n  is to add the feed's `meta` information to each article.\n\n- `feedurl` - The url (string) of the feed. FeedParser is very good at\n  resolving relative urls in feeds. But some feeds use relative urls without\n  declaring the `xml:base` attribute any place in the feed. This is perfectly\n  valid, but we don't know know the feed's url before we start parsing the feed\n  and trying to resolve those relative urls. If we discover the feed's url, we\n  will go back and resolve the relative urls we've already seen, but this takes\n  a little time (not much). If you want to be sure we never have to re-resolve\n  relative urls (or if FeedParser is failing to properly resolve relative urls),\n  you should set the `feedurl` option. Otherwise, feel free to ignore this option.\n\n- `resume_saxerror` - Set to `false` to override Feedparser's default behavior, which\n  is to emit any `SAXError` on `error` and then automatically resume parsing. In\n  my experience, `SAXErrors` are not usually fatal, so this is usually helpful\n  behavior. If you want total control over handling these errors and optionally\n  aborting parsing the feed, use this option.\n\n## Examples\n\nSee the [`examples`](examples/) directory.\n\n## API\n\n### Transform Stream\n\nFeedparser is a [transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) operating in \"object mode\": XML in -> Javascript objects out.\nEach readable chunk is an object representing an article in the feed.\n\n### Events Emitted\n\n* `meta` - called with feed `meta` when it has been parsed\n* `error` - called with `error` whenever there is a Feedparser error of any kind (SAXError, Feedparser error, etc.)\n\n## What is the parsed output produced by feedparser?\n\nFeedparser parses each feed into a `meta` (emitted on the `meta` event) portion\nand one or more `articles` (emited on the `data` event or readable after the `readable`\nis emitted).\n\nRegardless of the format of the feed, the `meta` and each `article` contain a\nuniform set of generic properties patterned after (although not identical to)\nthe RSS 2.0 format, as well as all of the properties originally contained in the\nfeed. So, for example, an Atom feed may have a `meta.description` property, but\nit will also have a `meta['atom:subtitle']` property.\n\nThe purpose of the generic properties is to provide the user a uniform interface\nfor accessing a feed's information without needing to know the feed's format\n(i.e., RSS versus Atom) or having to worry about handling the differences\nbetween the formats. However, the original information is also there, in case\nyou need it. In addition, Feedparser supports some popular namespace extensions\n(or portions of them), such as portions of the `itunes`, `media`, `feedburner`\nand `pheedo` extensions. So, for example, if a feed article contains either an\n`itunes:image` or `media:thumbnail`, the url for that image will be contained in\nthe article's `image.url` property.\n\nAll generic properties are \"pre-initialized\" to `null` (or empty arrays or\nobjects for certain properties). This should save you from having to do a lot of\nchecking for `undefined`, such as, for example, when you are using jade\ntemplates.\n\nIn addition, all properties (and namespace prefixes) use only lowercase letters,\nregardless of how they were capitalized in the original feed. (\"xmlUrl\" and\n\"pubDate\" also are still used to provide backwards compatibility.) This decision\nplaces ease-of-use over purity -- hopefully, you will never need to think about\nwhether you should camelCase \"pubDate\" ever again.\n\nThe `title` and `description` properties of `meta` and the `title` property of\neach `article` have any HTML stripped if you let feedparser normalize the output.\nIf you really need the HTML in those elements, there are always the originals:\ne.g., `meta['atom:subtitle']['#']`.\n\n### List of meta properties\n\n* title\n* description\n* link (website link)\n* xmlurl (the canonical link to the feed, as specified by the feed)\n* date (most recent update)\n* pubdate (original published date)\n* author\n* language\n* image (an Object containing `url` and `title` properties)\n* favicon (a link to the favicon -- only provided by Atom feeds)\n* copyright\n* generator\n* categories (an Array of Strings)\n\n### List of article properties\n\n* title\n* description (frequently, the full article content)\n* summary (frequently, an excerpt of the article content)\n* link\n* origlink (when FeedBurner or Pheedo puts a special tracking url in the `link` property, `origlink` contains the original link)\n* date (most recent update)\n* pubdate (original published date)\n* author\n* guid (a unique identifier for the article)\n* comments (a link to the article's comments section)\n* image (an Object containing `url` and `title` properties)\n* categories (an Array of Strings)\n* 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)\n* enclosures (an Array of Objects, each representing a podcast or other enclosure and having a `url` property and possibly `type` and `length` properties)\n* meta (an Object containing all the feed meta properties; especially handy when using the EventEmitter interface to listen to `article` emissions)\n\n## Help\n\n- Don't be afraid to report an [issue](https://github.com/danmactough/node-feedparser/issues).\n- You can drop by IRC, too: [#node-feedparser on freenode](http://webchat.freenode.net/?channels=node-feedparser&uio=d4).\n\n## Contributors\n\nView all the [contributors](https://github.com/danmactough/node-feedparser/graphs/contributors).\n\nAlthough `node-feedparser` no longer shares any code with `node-easyrss`, it was\nthe original inspiration and a starting point.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011-2014 Dan MacTough and contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the 'Software'), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
  "readmeFilename": "README.md",
  "_id": "feedparser@0.16.6",
  "_shasum": "6b6535faa16e21a1cc23c92b40e5660a3dd13b40",
  "_from": "feedparser@0.16.6",
  "_resolved": "https://registry.npmjs.org/feedparser/-/feedparser-0.16.6.tgz"
}
