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
  • 875
  • 2
  • 13
  • 26

1 Answers1

0

No. JavaScript itself does not support this.

sawa
  • 160,959
  • 41
  • 265
  • 366
Juanjo Salvador
  • 1,007
  • 1
  • 11
  • 32