Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hashrock/deno-opn
Opens stuff like websites, files, executables. Cross-platform, for Deno.
https://github.com/hashrock/deno-opn
Last synced: 2 days ago
JSON representation
Opens stuff like websites, files, executables. Cross-platform, for Deno.
- Host: GitHub
- URL: https://github.com/hashrock/deno-opn
- Owner: hashrock
- License: mit
- Created: 2018-12-24T13:46:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-14T09:10:26.000Z (over 2 years ago)
- Last Synced: 2024-08-03T10:20:48.364Z (3 months ago)
- Language: TypeScript
- Homepage: https://doc.deno.land/https/raw.githubusercontent.com/hashrock/deno-opn/master/opn.ts
- Size: 25.4 KB
- Stars: 40
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deno - deno-opn - 打开网站,文件,可执行文件之类的东西。 跨平台。 (Uncategorized / Uncategorized)
- awesome-deno-cn - @hashrock/deno-opn
- awesome-deno - deno-opn - Opens stuff like websites, files, executables. Cross-platform. (Libraries)
- awesome-deno - deno-opn - Opens stuff like websites, files, executables. Cross-platform.![GitHub stars](https://img.shields.io/github/stars/hashrock/deno-opn?style=plastic) (Modules / Online Playgrounds)
- awesome-deno - deno-opn - Opens stuff like websites, files, executables. Cross-platform. (Modules / Utils)
README
# Deno Opn
***A port of [OPN]***
[![Badge License]][License] [![Badge Port]][Hashrock] [![Badge Opn]][Opn]
## Usage
### Import
##### Latest
*Use the bleeding edge.*
```js
import { open } from 'https://github.com/hashrock/deno-opn/raw/master/mod.ts'
```##### Version
*Use a specific **[Release]** tag.*
```js
import { open } from 'https://github.com/hashrock/deno-opn/raw//mod.ts'
```v2.0.0
```js
import { open } from 'https://github.com/hashrock/deno-opn/raw/v2.0.0/mod.ts'
```v1.1.1(legacy)
```js
import { opn } from 'https://github.com/hashrock/deno-opn/raw/v1.1.1/opn.ts'
```
### File
*Open a file with the default image viewer.*
```js
await open('unicorn.png');
```
### URL
*Open a URL in the default browser.*
```js
await open('http://sindresorhus.com');
```
### With
*Open the target with a specific program.*
```js
await open('http://sindresorhus.com',{
with: [ 'firefox' ]
});
```
### Arguments
*Supply the program with arguments.*
```js
await open('http://sindresorhus.com',{
with: [ 'chrome' , '--incognito' ]
});
```
## Design
*Internally system specific commands*
*are used to start the child processes.*
| System | Command
|:----------------:|:----------:
| ![Badge Linux] | `gio open`
| ![Badge MacOS] | `start`
| ![Badge Windows] | `open`
## Contributions
***PRs welcome :)***
[Badge License]: https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge
[Badge Port]: https://img.shields.io/badge/Port-Hashrock-red.svg?style=for-the-badge
[Badge Opn]: https://img.shields.io/badge/Opn-Sindre_Sorhus-green.svg?style=for-the-badge[Badge Windows]: https://img.shields.io/badge/-0078D6.svg?style=for-the-badge&logo=windows&logoColor=white&logoWidth=200 'Windows'
[Badge Linux]: https://img.shields.io/badge/-87CF3E.svg?style=for-the-badge&logo=linux&logoColor=white&logoWidth=200 'Linux'
[Badge MacOS]: https://img.shields.io/badge/-darkgray.svg?style=for-the-badge&logo=apple&logoColor=white&logoWidth=200 'MacOS'[Sindre Sorhus]: https://sindresorhus.com 'Sorhus Website'
[Hashrock]: https://github.com/hashrock 'Hashrocks GitHub Profile'
[opn]: https://github.com/sindresorhus/opn 'The OPN Project Page'[Release]: https://github.com/hashrock/deno-opn/releases
[License]: LICENSE 'The license of this repository'