This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@sphido/feed

1.1.0 • Public • Published

@sphido/feed

Generate atom feed from pages

Install

yarn add @sphido/feed

Example

import fs from 'fs-extra';
import path from 'path';
import {fileURLToPath} from 'url';
import {feed} from '@sphido/feed';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const posts = [
	{
		title: 'First article',
		link: 'https://example.com/first',
		content: '<p>article content</p>',
		description: 'Short description',
		date: new Date()
	},
	{
		title: 'Second article',
		link: 'https://example.com/second',
		content: '<p>article content</p>',
		description: 'Short description',
		date: new Date()
	},
];

(async () => {

	const output = feed(
		posts,
		{
			title: 'Feed of example.com',
			description: 'This is my Atom feed',
			link: 'https://example.com',
		},
		'https://example.com/feed.xml'
	);

	await fs.outputFile(__dirname  + '/feed.xml', output);
})();

https://github.com/sphido/examples/tree/main/rss

Source codes

https://github.com/sphido/sphido/tree/main/packages/sphido-feed

Readme

Keywords

none

Package Sidebar

Install

npm i @sphido/feed

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

4.16 kB

Total Files

4

Last publish

Collaborators

  • ozzyczech