Skip to content

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

License

Notifications You must be signed in to change notification settings

fabiospampinato/tiny-open

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published