The SVG Synchronizer Tool provides real-time synchronization of SVG files between a producer and a server. When the producer generates a SVG file in a designated folder, it sends them to the server. The server receives the file, updating or creating the SVG file with the received content.
- Node.js and npm
.env
file with the required environment variables placed in the root directory
SERVER_URL
: The URL of the server including portSRC_SVG_FOLDER_PATH
: Relative path to the folder watched by the producer for SVG filesDEST_SVG_FOLDER_PATH
: Relative path to the folder where the server will save SVG filesSERVER_PORT
: Port on which the server listens
-
Clone the Repository
-
Update .env file
-
Install Dependencies:
npm install
-
Run the Server:
node src/server.ts
or Run the Producer (in a separate terminal window):
sh node src/producer.ts
- Place SVG files into the folder specified by
SVG_FOLDER_PATH
in your.env
file. - The producer detects any new or modified SVG files and sends them to the server.
- The server will save or overwrite these SVGs in the folder specified by
DEST_SVG_FOLDER_PATH
in your.env
file, retaining the filename.