UNPKG

documon

Version:

A documentation system for mortals. Use with any language.

22 lines 2.2 kB
{ "line": 36, "name": "opn", "shortText": "A cross-platform way to launch files from Node.", "shortHtml": "<p>A cross-platform way to launch files from Node.</p>", "text": "A cross-platform way to launch files from Node.\n\nDirect copy of:\nnpmjs: \thttps://www.npmjs.com/package/opn\ngithub: https://github.com/sindresorhus/opn\n\n\n### USAGE \n\n\n\tconst opn = require('opn');\n\n\t// Opens the image in the default image viewer\n\topn('unicorn.png').then(() => {\n\t\t// image viewer closed\n\t});\n\n\t// Opens the url in the default browser\n\topn('http://sindresorhus.com');\n\n\t// Specify the app to open in\n\topn('http://sindresorhus.com', {app: 'firefox'});\n\n\t// Specify app arguments\n\topn('http://sindresorhus.com', {app: ['google chrome', '--incognito']});\n\n", "html": "<p>A cross-platform way to launch files from Node.</p>\n<p>Direct copy of:<br />\nnpmjs: <a href=\"https://www.npmjs.com/package/opn\">https://www.npmjs.com/package/opn</a><br />\ngithub: <a href=\"https://github.com/sindresorhus/opn\">https://github.com/sindresorhus/opn</a></p>\n<h3 id=\"usage\">USAGE</h3>\n<pre><code>const opn = require('opn');\n\n// Opens the image in the default image viewer\nopn('unicorn.png').then(() =&gt; {\n // image viewer closed\n});\n\n// Opens the url in the default browser\nopn('http://sindresorhus.com');\n\n// Specify the app to open in\nopn('http://sindresorhus.com', {app: 'firefox'});\n\n// Specify app arguments\nopn('http://sindresorhus.com', {app: ['google chrome', '--incognito']});</code></pre>", "entity": "class", "flagSearchText": " opn documon", "package": "documon", "file": "documon/src/opn.js", "filename": "opn.js", "klass": "opn", "docfile": "documon.opn.html", "id": "documon.opn", "prettyLangs": [], "projectName": "Documon", "projectVersion": "2.5.5", "search": { "documon.opn": "opn : cross platform launch files from Node Direct copy npmjs https npmjs package github https github sindresorhus USAGE const require Opens image default image viewer unicorn then image viewer closed Opens default browser http sindresorhus Specify open http sindresorhus firefox Specify arguments http sindresorhus google chrome incognito" } }