https://github.com/abertschi/create-url-shortcut
Create an URL shortcut file
https://github.com/abertschi/create-url-shortcut
Last synced: about 2 months ago
JSON representation
Create an URL shortcut file
- Host: GitHub
- URL: https://github.com/abertschi/create-url-shortcut
- Owner: abertschi
- License: mit
- Created: 2016-03-25T12:29:09.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-26T11:11:56.000Z (about 9 years ago)
- Last Synced: 2025-03-03T19:47:12.839Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```js
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.
- http://fileinfo.com/extension/url
```
[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
```- http://fileinfo.com/extension/desktop
## 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](https://github.com/abertschi/create-url-shortcut-cli): CLI to create an url shortcut file
- [open-shortcut](https://github.com/sindresorhus/open-shortcut): Open the URL from a url shortcut file
- [shortcut-url](https://github.com/sindresorhus/shortcut-url): Get the URL from a url shortcut file## License

[](http://twitter.com/andrinbertschi)