npm.io
1.0.0 • Published 10 years ago

create-url-shortcut

Licence
MIT
Version
1.0.0
Deps
0
Vulns
0
Weekly
0
Stars
2

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

License

license: MIT twitter: @andrinbertschi