Linked Questions

10 votes
1 answer
10k views

I wish to send some parameters when running a node script, using for instance node myscript.js from the terminal, so it can be read as below: const fs = require('fs'); console.log(myParameter);
-1 votes
1 answer
2k views

From the following code I can read and console.log the line const readline = require('readline'); const { stdin: input, stdout: output } = require('process'); const rl = readline.createInterface({ ...
1 vote
1 answer
273 views

I make a connection with DB and select some information with a query in a python file. All information is stored in a variable. Then I start a js, but I want to send this information from python to ...
5 votes
0 answers
114 views

For my Loopback project, I need to load a huge data set from csv. Boot script takes nearly 30s to complete the data load. so its not an option. My plan is to load data only when loop back is started ...
0 votes
0 answers
56 views

So far this is my code: function number(numm){ var ones = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']; var result; var numString = num.toString(); if (num ==...
1520 votes
26 answers
1.1m views

The scripts portion of my package.json currently looks like this: "scripts": { "start": "node ./script.js server" } ...which means I can run npm start to start the ...
user avatar
365 votes
17 answers
361k views

I'm writing a web app in Node. If I've got some JS file db.js with a function init in it how could I call that function from the command line?
49 votes
5 answers
41k views

What is the correct syntax for running a Node.js script with command-line arguments on Linux or Mac? To run the script with no arguments, I would simply use the command node stuff.js, but in this ...
11 votes
4 answers
17k views

I'm new to Node and I'm trying to write a command-line tool in Node that would allow you to pass a string in as an argument. I saw that Node seems to break each word passed in as an array when using ...
michaellee's user avatar
  • 1,362
5 votes
1 answer
6k views

Given a jsdom based svgcreator.node.js script file : var jsdom = require('jsdom'); jsdom.env( "<html><body></body></html>", // CREATE DOM HOOK [ 'http://d3js.org/d3....
Hugolpz's user avatar
  • 18.5k
16 votes
3 answers
2k views

Google Maps and MSSQL seem to disagree on how to calculate the distance/length of a polyline/linestring using SRID 4326. MSSQL: SELECT geography::STGeomFromText('LINESTRING(-98.78 39.63,2.98 27.52)',...
9 votes
1 answer
5k views

NOTE: This is NOT about sending args to the top-level script, but to the script called by that script In my package.json, when I call a script that takes command line args directly, it works. But ...
5 votes
3 answers
4k views

# index.js console.log(process.argv) // expect this to print [.., .., '1'] # terminal $ echo 1 | node index.js // just prints [.., ..] What's the trick? How do I dynamically pass arguments to a node ...
Joseph Fraley's user avatar
6 votes
3 answers
12k views

I'm writting a command line program which calculates the total price of an order, using info from a CSV file. Data inside sample.catalog.csv: P1,5,1000.00 P2,8,250.00 P3,15,125.00 P4,10,250.00 P5,2,...
3 votes
1 answer
6k views

I run app.js with command node app.js It executes const inputData = require('./input.json'); Is it possible pass file name as argument to const inputData = require('./file.json'); from command ...
o.O's user avatar
  • 501

15 30 50 per page
1
2 3 4 5