Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

opn

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opn

A better node-open. Opens stuff like websites, files, executables. Cross-platform.

  • 4.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.1M
increased by11.65%
Maintainers
1
Weekly downloads
 
Created

What is opn?

The 'opn' npm package is a utility that can open stuff like websites, files, executables, etc., with their default applications. It is particularly useful for opening URLs in the default web browser from Node.js scripts.

What are opn's main functionalities?

Open websites in the default browser

This feature allows you to open a website URL in the default web browser from a Node.js script.

const opn = require('opn');
opn('https://www.example.com');

Open files with the default application

This feature allows you to open a file with its default application. For example, a PDF would be opened with the system's default PDF viewer.

const opn = require('opn');
opn('path/to/file.pdf');

Open executables

This feature allows you to open an executable file, which can be useful for launching applications from a Node.js script.

const opn = require('opn');
opn('path/to/application.exe');

Specify the app to open with

This feature allows you to specify which application to use when opening a URL or file, overriding the system default.

const opn = require('opn');
opn('https://www.example.com', {app: 'firefox'});

Other packages similar to opn

Keywords

FAQs

Package last updated on 17 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc