substack-feed-api 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1,103 @@
1
- # substack-feed-api
1
+ # Substack Feed API
2
+
3
+ The Substack Feed API is a powerful and flexible API designed to fetch and parse Substack newsletter feeds, making it easier for developers to integrate Substack content into their applications. Built with TypeScript, this API leverages modern JavaScript practices to provide a robust solution for accessing Substack newsletter data.
4
+
5
+ ## Features
6
+
7
+ - **Fetch Newsletter Feeds**: Easily retrieve the latest posts from any Substack newsletter.
8
+ - **Parse Feed Data**: Convert Substack newsletter feeds into a structured format for easy integration.
9
+ - **TypeScript Support**: Enjoy the benefits of TypeScript, with type definitions for all the API responses.
10
+ - **Customizable**: Flexible API that can be tailored to fit the needs of your application.
11
+
12
+ ## Getting Started
13
+
14
+ ### Prerequisites
15
+
16
+ - Node.js (version 20.x or higher)
17
+ - npm (latest version)
18
+
19
+ ### Installation
20
+
21
+ To use the Substack Feed API in your project, follow these steps:
22
+
23
+ 1. Install the package via npm:
24
+
25
+ ```bash
26
+ npm install substack-feed-api
27
+ ```
28
+
29
+ 2. Import the API into your project:
30
+
31
+ ```typescript
32
+ import { getSubstackFeed } from 'substack-feed-api';
33
+ ```
34
+
35
+ ### Usage
36
+
37
+ Here's a quick example to get you started:
38
+
39
+ ```typescript
40
+ getSubstackFeed('your-substack-newsletter-name')
41
+ .then((feed) => {
42
+ console.log(feed);
43
+ })
44
+ .catch((error) => {
45
+ console.error(error);
46
+ });
47
+ ```
48
+
49
+ There is also a possibility to pass your own callback function to the `getSubstackFeed` function.
50
+ This function will be called with the parsed feed data as an argument:
51
+
52
+ ```typescript
53
+ getSubstackFeed('your-substack-newsletter-name', (err, result) => {
54
+ console.log(result);
55
+ });
56
+ ```
57
+
58
+ You can also use the other exported functions from the package:
59
+ - `getFeedByLink`: Fetch a specific feed by its link.
60
+ - `getPosts`: Get all posts from a feed.
61
+
62
+ Replace `'your-substack-newsletter-name'` with the name of the Substack newsletter you wish to fetch.
63
+
64
+ ## Development
65
+
66
+ To contribute to the Substack Feed API or run it locally for development, you will need to follow these steps:
67
+
68
+ 1. Clone the repository:
69
+
70
+ ```bash
71
+ git clone https://github.com/rohit1901/substack-feed-api.git
72
+ ```
73
+
74
+ 2. Install dependencies:
75
+
76
+ ```bash
77
+ npm install
78
+ ```
79
+
80
+ 3. Run the development server:
81
+
82
+ ```bash
83
+ npm run dev
84
+ ```
85
+
86
+ ## Building
87
+
88
+ To build the project for production, run:
89
+
90
+ ```bash
91
+ npm run build
92
+ ```
93
+
94
+ This will generate the production-ready files in the `dist` directory.
95
+
96
+ ## Contributing
97
+
98
+ Contributions are welcome! Feel free to open an issue or submit a pull request if you have any improvements or bug fixes to suggest.
99
+
100
+ ## License
101
+
102
+ This project is licensed under the MIT License.
103
+ ```