0

I wrote a simple script in Ruby that accepts a file path as an argument from the terminal and then performs a task with that file.

EX:

files = ARGV

html = ""

file = File.open(files[0])

file.each do |line|
    html << line
end

code = html.gsub(/\s+/, "")
string = code.gsub(/"/, "'")

puts string

and from the terminal I can type ruby file.rb ~/path/to/file (the path is the argument being passed.)

Does JS have an argument vector like this?

Dear1ofGdBear
  • 935
  • 2
  • 13
  • 26

1 Answers1

0

No. JavaScript itself does not support this.

sawa
  • 165,429
  • 45
  • 277
  • 381
Juanjo Salvador
  • 1,073
  • 1
  • 12
  • 33