1.1.0 • Published 2 years ago
@sphido/feed v1.1.0
@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
1.1.0
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.2
3 years ago
1.0.3
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago