Skip to content

Commit 00b30c8

Browse files
authored
Merge pull request #59 from ndaidong/6.1.3
6.1.3
2 parents 5a68f9b + 5e5c897 commit 00b30c8

File tree

8 files changed

+205
-72
lines changed

8 files changed

+205
-72
lines changed

.github/workflows/ci-test.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,22 @@ on: [push, pull_request]
88
jobs:
99
test:
1010

11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
1212

1313
strategy:
1414
matrix:
15-
node_version: [14.x, 15.x, 16.x, 17.x, 18.x]
15+
node_version: [14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919

2020
- name: setup Node.js v${{ matrix.node_version }}
21-
uses: actions/setup-node@v1
21+
uses: actions/setup-node@v3
2222
with:
2323
node-version: ${{ matrix.node_version }}
2424

2525
- name: run npm scripts
2626
run: |
27-
npm i -g standard
2827
npm install
2928
npm run lint
3029
npm run build --if-present
@@ -36,7 +35,7 @@ jobs:
3635
github-token: ${{ secrets.GITHUB_TOKEN }}
3736

3837
- name: cache node modules
39-
uses: actions/cache@v2
38+
uses: actions/cache@v3
4039
with:
4140
path: ~/.npm
4241
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

CONTRIBUTING.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributing to feed-reader
2+
3+
While `feed-reader` is just a simple library with personal purpose, I'm happy if it can be useful for you too.
4+
5+
Anyway, I hope it always gets better, so pull requests are welcome, though larger proposals should be discussed first.
6+
7+
As an OSS, it should follow the Unix philosophy: "do one thing and do it well".
8+
9+
## Installation
10+
11+
- Ensure you have `node` and `npm` installed.
12+
- After cloning the repository, run `npm install` in the root of the repository.
13+
- Run `npm test` to ensure that everything works correctly in your environment.
14+
15+
If it works well, you can start modifying your fork.
16+
17+
In this process, you can use [`node eval.js` command](https://github.com/ndaidong/feed-reader#quick-evaluation) to evaluate your changes.
18+
19+
20+
## Third-party libraries
21+
22+
Please avoid using libaries other than those available in the standard library, unless necessary.
23+
24+
This library needs to be simple and flexible to run on multiple platforms such as Deno, Bun, or even browser.
25+
26+
27+
## Coding convention
28+
29+
Please follow [standardjs](https://standardjs.com/) style guide.
30+
31+
Make sure your code lints before opening a pull request.
32+
33+
34+
```bash
35+
cd feed-reader
36+
37+
# check coding convention issue
38+
npm run lint
39+
40+
# auto fix coding convention issue
41+
npm run lint:fix
42+
```
43+
44+
*When you run `npm test`, the linting process will be triggered at first.*
45+
46+
47+
## Testing
48+
49+
Be sure to run the unit test suite before opening a pull request. An example test run is shown below.
50+
51+
```bash
52+
cd feed-reader
53+
npm test
54+
```
55+
56+
![feed-reader unit test](https://i.imgur.com/xTwZK6B.png)
57+
58+
If test coverage decreased, please check test scripts and try to improve this number.
59+
60+
61+
## Documentation
62+
63+
If you've changed APIs, please update README and [the examples](https://github.com/ndaidong/feed-reader/tree/main/examples).
64+
65+
66+
## Clean commit histories
67+
68+
When you open a pull request, please ensure the commit history is clean.
69+
Squash the commits into logical blocks, perhaps a single commit if that makes sense.
70+
71+
What you want to avoid is commits such as "WIP" and "fix test" in the history.
72+
This is so we keep history on master clean and straightforward.
73+
74+
For people new to git, please refer the following guides:
75+
76+
- [Writing good commit messages](https://github.com/erlang/otp/wiki/writing-good-commit-messages)
77+
- [Commit Message Guidelines](https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53)
78+
79+
80+
## License
81+
82+
By contributing to `feed-reader`, you agree that your contributions will be licensed under its [MIT license](https://github.com/ndaidong/feed-reader/blob/main/LICENSE).
83+
84+
---

README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,27 @@ To read & normalize RSS/ATOM/JSON feed data.
88
![CodeQL](https://github.com/ndaidong/feed-reader/workflows/CodeQL/badge.svg)
99
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
1010

11-
[![Deploy](https://button.deta.dev/1/svg)](https://go.deta.dev/deploy?repo=https://github.com/ndaidong/feed-reader-deta)
11+
## Intro
12+
13+
*feed-reader* is a part of tool sets for content builder:
14+
15+
- [feed-reader](https://github.com/ndaidong/feed-reader): extract & normalize RSS/ATOM/JSON feed
16+
- [article-parser](https://github.com/ndaidong/article-parser): extract main article from given URL
17+
- [oembed-parser](https://github.com/ndaidong/oembed-parser): extract oEmbed data from supported providers
18+
19+
You can use one or combination of these tools to build news sites, create automated content systems for marketing campaign or gather dataset for NLP projects...
20+
21+
```
22+
┌────────────────┐
23+
┌───────► article-parser ├──────────┐
24+
│ └────────────────┘ │
25+
┌─────────────┐ ┌─────────┴────┐ ┌────────▼─────────┐ ┌─────────────┐
26+
│ feed-reader ├───► feed entries │ │ content database ├───► public APIs │
27+
└─────────────┘ └─────────┬────┘ └────────▲─────────┘ └─────────────┘
28+
│ ┌────────────────┐ │
29+
└───────► oembed-parser ├──────────┘
30+
└────────────────┘
31+
```
1232

1333
## Demo
1434

@@ -29,7 +49,7 @@ pnpm i feed-reader
2949
yarn add feed-reader
3050
```
3151

32-
```js
52+
```ts
3353
// es6 module
3454
import { read } from 'feed-reader'
3555

@@ -48,12 +68,18 @@ import { read } from 'https://esm.sh/feed-reader'
4868

4969
### Browser
5070

51-
```js
71+
```ts
5272
import { read } from 'https://unpkg.com/feed-reader@latest/dist/feed-reader.esm.js'
5373
```
5474

5575
Please check [the examples](https://github.com/ndaidong/feed-reader/tree/main/examples) for reference.
5676

77+
### Deta cloud
78+
79+
For [Deta](https://www.deta.sh/) devs please refer [the source code and guideline here](https://github.com/ndaidong/feed-reader-deta) or simply click the button below.
80+
81+
[![Deploy](https://button.deta.dev/1/svg)](https://go.deta.dev/deploy?repo=https://github.com/ndaidong/feed-reader-deta)
82+
5783

5884
## APIs
5985

@@ -63,7 +89,7 @@ Load and extract feed data from given RSS/ATOM/JSON source. Return a Promise obj
6389

6490
#### Syntax
6591

66-
```js
92+
```ts
6793
read(String url)
6894
read(String url, Object options)
6995
read(String url, Object options, Object fetchOptions)
@@ -91,7 +117,7 @@ read('https://news.google.com/atom').then(result => console.log(result))
91117

92118
Without any options, the result should have the following structure:
93119

94-
```js
120+
```ts
95121
{
96122
title: String,
97123
link: String,
@@ -124,7 +150,7 @@ Object with all or several of the following properties:
124150

125151
For example:
126152

127-
```js
153+
```ts
128154
import { read } from 'feed-reader'
129155

130156
read('https://news.google.com/atom', {
@@ -135,7 +161,7 @@ read('https://news.google.com/rss', {
135161
useISODateFormat: false,
136162
getExtraFeedFields: (feedData) => {
137163
return {
138-
subtitle: feed.subtitle || ''
164+
subtitle: feedData.subtitle || ''
139165
}
140166
},
141167
getExtraEntryFields: (feedEntry) => {

SECURITY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Due to resource limitations, only the latest stable minor release is getting bugfixes (including security ones).
6+
7+
So e.g. if the latest stable version is 6.1.3, then 6.1.x line will still get security fixes but older versions (like 6.0.x) won't get any fixes.
8+
9+
Description above is a general rule and may be altered on case by case basis.
10+
11+
## Reporting a Vulnerability
12+
13+
You can report low severity vulnerabilities as GitHub issues.
14+
15+
More severe vulnerabilities should be reported to the my email [email protected] or Twitter [@ndaidong](https://twitter.com/ndaidong).
16+
17+
---

0 commit comments

Comments
 (0)