This utility is designed to help you automatically download your invoices from Stripe for a specified year. Using this command-line utility, you can define where the invoices are saved and how many files to download in parallel to make the process efficient.
- Download all invoices for a specified year.
- Optimize download speed by defining the number of parallel downloads.
- Set custom directory for storing downloaded invoices.
- Node.js
- A Stripe account with a secret key.
- Properly set up .env file with the Stripe secret key.
-
Install Dependencies:
After cloning the repository, navigate to the project directory and run:
npm install
-
Environment Variables:
Rename the
.env.example
file to.env
and update theSTRIPE_SECRET_KEY
with your Stripe secret key.STRIPE_SECRET_KEY=your_stripe_secret_key_here
To download invoices:
node app.js download --years=2023,2022
Available options:
-
--years
: Define the years you want to download invoices for. (Required) -
--parallel
: Number of invoices to download in parallel. Default is 10.node app.js download --years=2023,2022 --parallel=5
-
--path
: Define the directory path where you want to save the invoices. By default, it will save in the current directory.node app.js download --years=2023,2022 --path=/path/to/directory
If you run into any issues:
- Ensure you have a valid Stripe secret key set in the
.env
file. - Ensure that you have the required permissions on the directory you're trying to save the invoices to.
- Verify that you have a stable internet connection.
Contributions are welcome! If you find a bug or think of a new feature, please open an issue or submit a pull request.
Creative Commons Attribution (CC BY)