From 3c784b5271b6681a19252115c6739fe520cd4dcb Mon Sep 17 00:00:00 2001 From: Dennis Iversen Date: Mon, 18 Nov 2024 13:17:58 +0100 Subject: [PATCH] add script for adding empty rows --- bin/add-rows.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/add-rows.js b/bin/add-rows.js index d7fd4ef..62fdcc8 100644 --- a/bin/add-rows.js +++ b/bin/add-rows.js @@ -1,11 +1,14 @@ // get first parameter 'url' from the command line // get second parameter 'num_rows' from the command line + const url = process.argv[2]; const num_rows = process.argv[3]; +const fs = require('fs'); // if not parameters passed, show error message if (!url || !num_rows) { console.log('Please provide URL and number of rows.'); + console.log('Example: node bin/add-rows.js https://example.com 10'); process.exit(1); } @@ -16,9 +19,6 @@ function generateRandomString() { // Add rows to the CSV file in this format // File,URL -// random-string.html,url -const fs = require('fs'); - const rows = []; for (let i = 0; i < num_rows; i++) { const randomString = generateRandomString();