deno-opn
deno-opn copied to clipboard
Opens stuff like websites, files, executables. Cross-platform, for Deno.
Import
Latest
Use the bleeding edge.
import { open } from 'https://github.com/hashrock/deno-opn/raw/master/mod.ts'
Version
Use a specific Release tag.
import { open } from 'https://github.com/hashrock/deno-opn/raw/<Version Tag>/mod.ts'
v2.0.0
import { open } from 'https://github.com/hashrock/deno-opn/raw/v2.0.0/mod.ts'
v1.1.1(legacy)
import { opn } from 'https://github.com/hashrock/deno-opn/raw/v1.1.1/opn.ts'
File
Open a file with the default image viewer.
await open('unicorn.png');
URL
Open a URL in the default browser.
await open('http://sindresorhus.com');
With
Open the target with a specific program.
await open('http://sindresorhus.com',{
with: [ 'firefox' ]
});
Arguments
Supply the program with arguments.
await open('http://sindresorhus.com',{
with: [ 'chrome' , '--incognito' ]
});
Design
Internally system specific commands
are used to start the child processes.
System | Command |
---|---|
gio open |
|
start |
|
open |
Contributions
PRs welcome :)