create-url-shortcut
Create an URL shortcut file
This module creates a platform dependent shortcut file to an Internet location, such as a Web address.
Install
$ npm install create-url-shortcut --save
Usage
const createShortcutUrl = require('create-url-shortcut');
var shortcut = createShortcutUrl('http://google.ch');
console.log(shortcut);
// {
// value: '[InternetShortcut]\nURL=' + http://google.ch + '\n'',
// ext: 'url'
// };
For Windows and Mac OS X, data for a file with the extension url is generated.
[InternetShortcut]
URL=http://google.ch
For Unix-Like operating systems, data for a file with the extension desktop is generated.
[Desktop Entry]
Encoding=UTF-8
URL=http://google.ch
Type=Link
Icon=text-html
API
createShortcutUrl(webAddress): urlShortcut
webAddress
- Type: string
Internet location to refer to
urlShortcut
- Return type: object
urlShortcut.value
- Type: string
The data for the url shortcut file
urlShortcut.ext
- Type: string
The platform dependent file extension.
- For Windows and Mac OS X: url
- For Unix like operating systems: desktop
Related packages
- create-url-shortcut-cli: CLI to create an url shortcut file
- open-shortcut: Open the URL from a url shortcut file
- shortcut-url: Get the URL from a url shortcut file