1

I have a .url file like so:

[internetShortcut]
url=http://www.stackoverflow.com

When I double-click on this file, it opens a link in my browser to Stack Overflow, as it should.

I incorrectly thought that the format of this file was TOML, but it's not - quotes cannot surround the url given under internetShortcut.url.

What is the format of the file, and how can I best parse it (in NodeJS)?

2 Answers 2

2

Well that didn't take very long.

Turns out that the file format was the good ol' .ini file format.

I've been messing around too much with Go and Rust lately, and that's changed my train of thought to the reverse of what is regular (first thinking of INI, rather than TOML :P)

To anyone else needing to parse .url files in JavaScript, the ini package is a good idea: https://github.com/npm/ini.

Sign up to request clarification or add additional context in comments.

Comments

1

It is a Microsoft Internet Shortcut, originally developed to store Internet Explorer favourites. I presume you're supposed to use Windows APIs to interact with it rather than writing your own parser.

In the context of the Node ecosystem, there seem to be some implementations, probably because the format is not complicated and was easy to support.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.