1.0.0 • Published 8 years ago

create-url-shortcut v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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

License

license: MIT twitter: @andrinbertschi