https://github.com/foxoman/openurl
Open Any Url/File in the default App / WebBrowser - based on nim std/browsers
https://github.com/foxoman/openurl
nim open uri url
Last synced: about 1 month ago
JSON representation
Open Any Url/File in the default App / WebBrowser - based on nim std/browsers
- Host: GitHub
- URL: https://github.com/foxoman/openurl
- Owner: foxoman
- License: mit
- Created: 2022-06-19T18:25:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T14:24:24.000Z (about 1 month ago)
- Last Synced: 2025-03-28T15:29:41.847Z (about 1 month ago)
- Topics: nim, open, uri, url
- Language: Nim
- Homepage:
- Size: 200 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openurl
```
_ _
/ \ ._ _ ._ | | |_) |
\_/ |_) (/_ | | |_| | \ |_
| @FOXOMAN
```
Open Any Url/File in the default App / WebBrowser
Sultan Al Isaee ~ foxoman @2022See MIT LICENSE.txt for details of the license.
Support for MacOS, Windows, Haiku, android/termux, Unix/Linux.
### Install
```nimble install openurl```### API
```openurl(PATH)```
*PATH* can be a file/folder url or a website or even empty to open blank page
in a browser.- **use raw string for file/folder path** ie: ```openurl(r"c:\dev\folder") ```
- `url` for a website should start with http or https
- compile with `-d:droid` to have support for android activity,in termux no need
to do that as unix `open` is supported.### Example
```````````````````````````
import openurlwhen isMainModule:
echo """
_ _
/ \ ._ _ ._ | | |_) |
\_/ |_) (/_ | | |_| | \ |_
| @FOXOMAN
"""if paramCount() > 0:
echo "[✔] Open: $1" % [prepare paramStr(1)]
openUrl(paramStr(1))
else:
echo "[✖] No URL input, a blank page will open."
openUrl()