tiny-open
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Tiny Open

A tiny utility for opening a file or a URL with its default application, or a custom one.

This uses open under macOS, xdg-open under Linux, and start under Windows.

Install

npm install tiny-open

Usage

import open from 'tiny-open';

// Let's open a file

open ( '/path/to/some/file.txt' ); // => Promise<boolean>

// Let's open a URL

open ( 'https://google.com' ); // => Promise<boolean>

// Let's open a URL with a custom application

open ( 'https://google.com', 'Google Chrome' ); // MacOS
open ( 'https://google.com', 'chrome' ); // Windows
open ( 'https://google.com', 'google-chrome' ); // Linux

License

MIT © Fabio Spampinato

Readme

Keywords

Package Sidebar

Install

npm i tiny-open

Weekly Downloads

928

Version

1.2.0

License

MIT

Unpacked Size

3.86 kB

Total Files

9

Last publish

Collaborators

  • fabiospampinato