1.0.2 • Published 3 years ago

winlink v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Write & Read Windows .LNK files in pure JS

Implemented following the [MS-SHLLINK] Shell Link (.LNK) Binary File Format Documentation.

While the documentation above is a good starting point, it is missing essential information about the LinkTargetIDList-ItemID structure. This information was obtained by:

Feel free to improve this library, but please make sure to read all sources above before.

Installation:

npm install winlink

Usage:

const winlink = require("winlink");

/* create file-link: writeFile( filename, target ) */
winlink.writeFile( "a.lnk", "C:\\temp\\a.txt" )
.then( () => console.log( "file link created" ) )
.catch( console.log.bind( console ) );

/* create directory-link: writeDirectory( filename, target ) */
winlink.writeDirectory( "test.lnk", "C:\\temp" )
.then( () => console.log( "directory link created" ) )
.catch( console.log.bind( console ) );

Motivation for pure JavaScript:

My intention is to write .lnk-files on samba-mounts under linux without using wine or other helpers.