Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
examples
src
test
.gitignore
.npmignore
package.json
readme.md

readme.md

@sphido/feed

Install

yarn add @sphido/feed

Example

const {outputFile} = require('fs-extra');
const SphidoFeed = require('@sphido/feed');

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 feed = SphidoFeed(
		posts,
		{
			title: 'Feed of example.com',
			description: 'This is my Atom feed',
			link: 'https://example.com',
		},
		'https://example.com/feed.xml'
	);

	await outputFile(__dirname  + '/feed.xml', feed);
})();
You can’t perform that action at this time.