I am writing a batch script in order to beautify JavaScript code. It needs to work on both Windows and Linux.   How can I beautify JavaScript code using the command line tools?...
I'm getting started with Grunt and wanting to pass a variable to a PhantomJS script I'm running via exec. What I want to be able to do is pass a url in for the script to take the screen capture from. Any help would be greatly appreciated, tha...
I am new to the whole ES6 concept and I am currently trying to use the export and import modules. I have a simple code that just logs something to the console. Below are the codes  autoincrementId.js  export default function autoincrementId() {   ret...
I need to set an environment variable from Node (currently using v8.9.3)  Ideally, I would like to run export DATA_DIR=/var/lib/data when the program starts.  1. Tried spawning a child_process to set this, but it does not appear to work.  Example:  c...
To run a node command within the "context" of your installed node_modules, you can make an entry in the scripts field of package.json.  Eg:  ...   "scripts": {     "test": "mocha --recursive test/**/*.js --compilers js:bab...
Synchronous child process calls are now available in the versions of Node.js that are under development (i.e. unstable). This is great news for writing shell scripts, as it will allow code like this:  var history = child_process.execSync('git log...
I have a question regarding JavaScript and methods by which its code can be run. As we know, there is some JavaScript code embedded in  tags and it runs natively within browser window - that's quite common and that's how the web pages current...
I'm completely lost with figuring out why my PHP script produces different results when run via CLI (producing the right results) vs when run within Node.js via the exec function.  Here's my PHP. Note the fopen('blah.txt', 'w'...
Lets say I develop a global npm module called mytool that registers a env variable through "bin" in package.json with the name mytool.  So after I install it globally by typing  npm install mytool -g   then I can type mytool --someOption in t...
I have built a GUI with Node.js that allows a user to run custom binaries, designed for CLI. These binaries are spawned with child_process module. A user is able to write to stdin and read from stdout of those child processes.  Yet, when a binary use...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.