Skip to content

Commit dd766b7

Browse files
committed
README: add
1 parent 2a6d677 commit dd766b7

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# README
2+
3+
JSON Feed generator
4+
5+
6+
7+
## Features
8+
9+
- spec-compliant
10+
- simple, flexible and fully-typed API
11+
- tiny, zero dependencies
12+
13+
14+
15+
## Usage
16+
17+
```js
18+
import { Feed } from "@vwkd/feed";
19+
20+
const feed = new Feed({
21+
title: "My Example Feed",
22+
home_page_url: "https://example.org",
23+
feed_url: "https://example.org/feed.json",
24+
});
25+
26+
feed.add({
27+
id: "1",
28+
content_html: "<p>Hello, world!</p>",
29+
url: "https://example.org/initial-post",
30+
});
31+
32+
feed.add(...[
33+
{
34+
id: "2",
35+
content_text: "This is a second item.",
36+
url: "https://example.org/second-item",
37+
},
38+
{
39+
id: "3",
40+
content_html: "<p>This is a third item.</p>",
41+
content_text: "This is a third item.",
42+
url: "https://example.org/third-item",
43+
},
44+
]);
45+
46+
const json = feed.toJSON();
47+
```
48+
49+
50+
51+
## Resources
52+
53+
- [JSON Feed Version 1.1](https://www.jsonfeed.org/version/1.1/)

0 commit comments

Comments
 (0)