Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-urlfile
Parse and create .url (bookmark) files
https://github.com/bahamas10/node-urlfile
Last synced: about 2 months ago
JSON representation
Parse and create .url (bookmark) files
- Host: GitHub
- URL: https://github.com/bahamas10/node-urlfile
- Owner: bahamas10
- Created: 2013-01-06T23:33:03.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-07T07:21:54.000Z (almost 12 years ago)
- Last Synced: 2024-04-14T00:47:35.198Z (8 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
urlfile
=======Parse and create .url (bookmark) files
Usage
-----Given a URL file called `daveeddy.com.url`
``` ini
[InternetShortcut]
URL=http://www.daveeddy.com
```Parse the URL file async
``` js
var urlfile = require('urlfile');
urlfile.parseURLFile('daveeddy.com.url', function(err, url) {
// url => 'http://www.daveeddy.com'
});
```Parse the URL file sync
``` js
var urlfile = require('urlfile');
var url = urlfile.parseURLFileSync('daveeddy.com.url');
// url => 'http://www.daveeddy.com'
```Parse a URL file string
``` js
var urlfile = require('urlfile');
var url = urlfile.parseString('[InternetShortcut]\r\nURL=http://www.daveeddy.com');
// url => 'http://www.daveeddy.com'
```Create a URL file string
``` js
var urlfile = require('urlfile');
var s = urlfile.createURL('http://www.daveeddy.com');
// s => '[InternetShortcut]\r\nURL=http://www.daveeddy.com'
```Functions
---------* urlfile.parseURLFile(file, function(err, url))
* urlfile.parseURLFileSync(file)
* urlfile.parseString(string)
* urlfile.createURL(url)The 3 synchronus functions will throw any errors they encounter
Installation
------------npm install urlfile
License
-------MIT License