![]() ![]() This object contains getter/setter functions to retrieve the paths of some popular web browsers on the operating system in use. The open.apps object provides a cross-platform solution for opening URLs with specific web browsers. Cross-Platform URL Handling With the open.apps Object Here, the value of app.name contains the file path to the FireFox executable. Build a Simple Beginner App with Node, Bootstrap & MongoDB What Well Be Building Basic Setup Initialize the Application Basic Templating with Pug Dealing. Here’s an example of opening a website in a specific browser: const fireFox = "C:/Program Files (x86)/Mozilla Firefox/firefox.exe" This results in a Windows machine using Microsoft Word to open the text document. Install Node.js and global dependencies Step 3: Clone projects automatically Step 4: Add environment variables Step 5. In the case above, the winWord variable holds the file path to Microsoft Word, and the name property of the app object in the options object is set to the winWord variable. To open a file in a specific application, you need to pass the path of that application into the options object. Here's an example of how to open a text document with Microsoft Word on a Windows machine: const open = require( "open") Ĭonst winWord = "C:/Program Files (x86)/Microsoft Office/Office15/WINWORD.EXE" ![]() For example, you can select an application that you want to use to open the file or URL. ![]() You can pass an options object to the open() function to specify how to open the file. Specifying Applications to Open Files or URLs ![]()
0 Comments
Leave a Reply. |