Prerequisites
Before you begin, it is important that your development environment set up properly.
# Install Node.js
To be able to write new RSS rules, you must first install Node.js first. RSSHub uses Node.js to run its code and create RSS feeds and requires Node v16 or above. You can download the latest LTS version of Node.js from here (opens new window).
On Windows, you can simply download the installer and follow the steps from the installer. Remember to check the option to install Tools for Native Modules as well.
On macOS, you can either download the installer from the Node.js website or use Homebrew (opens new window) to install Node.js with the command brew install node
.
On Linux, you can refer to this page (opens new window) to decide how to install Node.js.
# Install a code editor
To write code, you need a code editor. If you already have one, you can skip this section. If you don't have one, you can choose one from the following list:
- Visual Studio Code (opens new window)
- WebStorm (opens new window)
- Neovim (opens new window)
- Sublime Text (opens new window)
To speed up the development process and make it easier to keep your code clean, you can install some appropriate extensions to the code editor of your choice. In the latter part of this guide, we will use Visual Studio Code as an example, you can install the following extensions:
- Art Template Helper (opens new window)(provides syntax highlighting for a template engine used by RSSHub)
- EditorConfig for VS Code (opens new window)(maintain consistent coding styles across different editors and IDEs)
- ESLint (opens new window)(identify and fix common errors in your code)
- Prettier - Code formatter (opens new window)(formats your code to make it more readable and consistent)
# Cloud hosted development environment
If you don't want to install Node.js and a code editor on your computer, you can use a cloud-hosted development environment. You may use GitHub Codespaces (opens new window) or Gitpod (opens new window). Just click one of the buttons below to start a new workspace:
For more information about how to use GitHub Codespaces (opens new window) or Gitpod (opens new window) , see GitHub's documentation (opens new window) and Gitpod's documentation (opens new window).