{"_id":"@amdglobal/create-desktop-shortcuts","_rev":"7-f82462fc81a485480200dfc498cb92c1","name":"@amdglobal/create-desktop-shortcuts","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.1":{"name":"@amdglobal/create-desktop-shortcuts","version":"1.1.1","keywords":["Desktop Shortcuts","desktop icon","cross-platform","alias","lnk"],"author":{"name":"The Jared Wilcurt"},"license":"MIT","_id":"@amdglobal/create-desktop-shortcuts@1.1.1","maintainers":[{"name":"fauxsoup","email":"fauxsoup@gmail.com"}],"homepage":"https://github.com/nwutils/create-desktop-shortcuts#readme","bugs":{"url":"https://github.com/nwutils/create-desktop-shortcuts/issues"},"dist":{"shasum":"70650078dcefcb99e6a11fda1b1aa6d62a12731a","tarball":"https://registry.npmjs.org/@amdglobal/create-desktop-shortcuts/-/create-desktop-shortcuts-1.1.1.tgz","fileCount":8,"integrity":"sha512-7Efm5DnArBuk5NH8lK6vNnqyXMN0X9zRs6ZZpyQhSgVh47lwvB8VyCdvwgCKap8QacBaTbyH6VxJt/2n0jcR+Q==","signatures":[{"sig":"MEYCIQD2bSBtITZKGZnmbOjBuqS9ztyTcvXL5hVC7s3gDTwatwIhALUCa4qlSYpb0Fu1Vu6rCW3O5VRE9eTR7ShveyZo018q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg5SCCRA9TVsSAnZWagAAjT0QAJeYkmjzrcvcaH76JZQG\nPu6vHV34eG8FvouqU4EwimPy4Nf4XZFoH5YugtXW6/KVwlVznU+35W6WVpT4\nIm041X4W3DvilnHmxIVvKZnxjiIV0Nl2B/B51gyRzkKb6aTBDltsf7yrWHLa\ni2Qo1S+6tQuNFjUzz0his4FxOnuR5OhdudSVLCHQD8yzXqdiOReSlJcfJ0As\n/ybpNRGaJuCwkBUqjC64slTfWnL5xUCd1VAL1imzPDNOZ1/7IqQcIpyRa7nM\n6ndSZ4Ig+mk/5h3D3zM7eQESQkO7aiTauEiXHyy8C0nt87nHY2CbxKZxdzCE\nGdynEHPY8EDuF8C8pxki1cbcmu77e7APxegIF/DV8X1EmElGv2IpSqct6/tZ\nNCgve15GPORSbwgCw3Sqgiv+o2zLMrIUNpzI3JpzpCkcG8QcqNhh828rnwzH\njHr7x2NcXDSn2XNDNWLZwv3FO1eYUxcgj9JfEbtEtdqaRBXop9RyjkUOemt+\n0Ioh1qXz2C4MEjnpRQ9qwExHiGZGy+TCV3v3DIMUFGzqTvDJZUpm0olN69B8\npL3Tq/hgePR9tE0rYZ76nGdZ//pOP1M3o6V6BYIVUotaFPDB4naMme2oct0u\nbiOzxLehCuv+OfnzwgE/iSlbenvf4LNSHq7SDlKxEvjApcQnbodRF2TMBth+\nOTVJ\r\n=zCRe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"67754e228157bed6db4ccaa94cb9ac7f039622bc","scripts":{"e2e":"node ./tests/e2e.js","fix":"eslint --fix --config=.eslintrc.js index.js src tests manual-testing.js","lint":"eslint --config=.eslintrc.js index.js src tests manual-testing.js","test":"jest --runInBand --coverage","debug":"node --inspect-brk manual-testing.js","start":"node index.js","manual-test":"node manual-testing.js"},"_npmUser":{"name":"fauxsoup","email":"fauxsoup@gmail.com"},"repository":{"url":"git+https://github.com/nwutils/create-desktop-shortcuts.git","type":"git"},"_npmVersion":"6.14.4","description":"Easy API to create desktop shortcuts with Node","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"devDependencies":{"jest":"24.9.0","eslint":"^7.10.0","mock-fs":"^4.13.0","babel-eslint":"^10.1.0","eslint-plugin-jsdoc":"^30.6.2","eslint-config-tjw-base":"^1.0.0","eslint-config-tjw-jest":"^1.0.0"},"ManifestComments":["Pinned jest to 24.9.0. 25.1.0 is broken on Windows. Waiting for issue #9459 to be resolved."],"_npmOperationalInternal":{"tmp":"tmp/create-desktop-shortcuts_1.1.1_1602458753456_0.7781353380779228","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-10-11T23:25:53.261Z","modified":"2026-06-16T18:11:29.842Z","1.1.1":"2020-10-11T23:25:53.604Z"},"bugs":{"url":"https://github.com/nwutils/create-desktop-shortcuts/issues"},"author":{"name":"The Jared Wilcurt"},"license":"MIT","homepage":"https://github.com/nwutils/create-desktop-shortcuts#readme","keywords":["Desktop Shortcuts","desktop icon","cross-platform","alias","lnk"],"repository":{"url":"git+https://github.com/nwutils/create-desktop-shortcuts.git","type":"git"},"description":"Easy API to create desktop shortcuts with Node","maintainers":[{"email":"ganesh.r@excelglobalsolution.com","name":"ganeshr"},{"email":"muhammadyounus.shaik@excelglobalsolution.com","name":"younus183"},{"email":"fauxsoup@gmail.com","name":"fauxsoup"},{"email":"rohitkumar.padala@excelglobalsolution.com","name":"rohitkumarpadala"},{"email":"sean@amdtelemedicine.com","name":"dayburner"},{"email":"chip@amdtelemedicine.com","name":"chipmcintosh"}],"readme":"\n# create-desktop-shortcuts\n\n[![Build Status](https://github.com/nwutils/create-desktop-shortcuts/workflows/Build%20Status/badge.svg)](https://github.com/nwutils/create-desktop-shortcuts/actions?query=workflow%3A%22Build+Status%22+branch%3Amaster) [![Unit Test Coverage: 100%](https://img.shields.io/badge/Test%20Coverage-100%25-brightgreen.svg?logo=jest)](https://github.com/nwutils/create-desktop-shortcuts/actions?query=workflow%3A%22Build+Status%22+branch%3Amaster) [![End-to-End Windows Passing](https://img.shields.io/badge/E2E-Passing-brightgreen.svg?logo=windows)](https://github.com/nwutils/create-desktop-shortcuts/actions?query=workflow%3A%22Build+Status%22+branch%3Amaster) [![End-to-End Linux Passing](https://img.shields.io/badge/E2E-Passing-brightgreen.svg?logo=ubuntu)](https://github.com/nwutils/create-desktop-shortcuts/actions?query=workflow%3A%22Build+Status%22+branch%3Amaster) [![End-to-End OSX Passing](https://img.shields.io/badge/E2E-Passing-brightgreen.svg?logo=apple)](https://github.com/nwutils/create-desktop-shortcuts/actions?query=workflow%3A%22Build+Status%22+branch%3Amaster) [![Lint Coverage: 100%](https://img.shields.io/badge/Lint%20Coverage-100%25-brightgreen.svg?logo=eslint)](https://github.com/tjw-lint) [![Compatible with Node 8.3+](https://img.shields.io/badge/Node-%3E%3D8.3.0-brightgreen.svg?logo=Node.js)](/package.json) [![Code of Conduct: No Ideologies](https://img.shields.io/badge/CoC-No%20Ideologies-blue)](/CODE_OF_CONDUCT.md) [![MIT Licensed](https://img.shields.io/badge/License-MIT-brightgreen)](/LICENSE)\n\n\n## Small, lightweight, cross-platform, built in validation!\n\n\n### Zero Dependencies, 100% Test Coverage, Automated Cross-Platform End-to-End tested \n\nAn easy, cross-platform, API to create desktop shortcuts with Node. (*Works in [NW.js](https://nwjs.io) too!*)\n\nThis library is completely **synchronous**.\n\n\n## Installation\n\n```\nnpm install --save create-desktop-shortcuts\n```\n\n\n### Examples\n\n**Simple example:**\n\n```js\nconst createDesktopShortcut = require('create-desktop-shortcuts');\n\nconst shortcutsCreated = createDesktopShortcut({\n  windows: { filePath: 'C:\\\\path\\\\to\\\\executable.exe' },\n  linux:   { filePath: '/home/path/to/executable'     },\n  osx:     { filePath: '/home/path/to/executable'     }\n});\n\nif (shortcutsCreated) {\n  console.log('Everything worked correctly!');\n} else {\n  console.log('Could not create the icon or set its permissions (in Linux if \"chmod\" is set to true, or not set)');\n}\n```\n\n**Advanced Example:**\n\nEach OS handles the concept of a shortcut icon slightly differently. So they each have a slightly different API, but I tried to keep them similar when they overlap.\n\n```js\nconst createDesktopShortcut = require('create-desktop-shortcuts');\n\nconst shortcutsCreated = createDesktopShortcut({\n  // OPTIONAL: defaults to true\n  onlyCurrentOS: true,\n  // OPTIONAL: defaults to true\n  verbose: true,\n  /**\n   * OPTIONAL: console.error is called by default if verbose: true.\n   *\n   * Your own custom logging function called with helpful warning/error\n   * messages from the internal validators. Only used if verbose: true.\n   *\n   * @param  {string} message The human readable warning/error message\n   * @param  {object} error   Sometimes an error or options object is passed\n   */\n  customLogger: function (message, error) {\n    console.log(message, error);\n  },\n  windows: {\n    // REQUIRED: Path must exist\n    filePath: 'C:\\\\path\\\\to\\\\executable.exe',\n    // OPTIONAL: Defaults to the Desktop of the current user\n    outputPath: 'C:\\\\some\\\\folder',\n    // OPTIONAL: defaults to the filePath file's name (without the extension)\n    name: 'My App Name',\n    // OPTIONAL\n    comment: 'My App description',\n    // OPTIONAL: File must exist and be ICO, EXE, or PNG\n    icon: 'C:\\\\path\\\\to\\\\file.ico',\n    // OPTIONAL\n    arguments: '--my-argument -f \\'other stuff\\'',\n    // OPTIONAL: defaults to 'normal'\n    windowMode: 'normal',\n    // OPTIONAL\n    hotkey: 'ALT+CTRL+F'\n  },\n  linux: {\n    // REQUIRED: Path must exist\n    filePath: '/home/path/to/executable',\n    // OPTIONAL: Defaults to the Desktop of the current user\n    outputPath: '/home/some/folder',\n    // OPTIONAL: defaults to the filePath file's name (without the extension)\n    name: 'My App Name',\n    // OPTIONAL\n    description: 'My app description',\n    // OPTIONAL: File must exist and be PNG or ICNS\n    icon: '/home/path/to/file.png',\n    // OPTIONAL: 'Application', 'Directory', or 'Link' (must logically match filePath)\n    type: 'Application',\n    // OPTIONAL: defaults to false\n    terminal: false,\n    // OPTIONAL: defaults to true\n    chmod: true\n  },\n  osx: {\n    // REQUIRED: Path must exist\n    filePath: '/Applications/My App.app',\n    // OPTIONAL: Defaults to the Desktop of the current user\n    outputPath: '/home/some/folder',\n    // OPTIONAL: defaults to the filePath file's name (without the extension)\n    name: 'My App Name',\n    // OPTIONAL: defaults to false\n    overwrite: false\n  }\n});\n\n// returns true if everything worked correctly, or false if it could not create the icon or set its permissions\nconsole.log(shortcutsCreated);\n```\n\n\n## Documentation\n\n\n### Global Settings\n\nKey             | Type     | Allowed         | Default         | Description\n:--             | :--      | :--             | :--             | :--\n`onlyCurrentOS` | Boolean  | `true`, `false` | `true`          | If true and you pass in objects for multiple OS's, this will only create a shortcut for the OS it was ran on.\n`verbose`       | Boolean  | `true`, `false` | `true`          | If true, consoles out helpful warnings and errors using `customLogger` or `console.error`.\n`customLogger`  | Function | Any function    | `console.error` | You can pass in your own custom function to log errors/warnings to. When called the function will receive a `message` string for the first argument and sometimes an `error` object for the second argument. This is useful in NW.js to see the messages logged to the regular Chromium Developer Tools instead of the background page's developer tools. But this can also be useful in other scenarios, like adding in custom wrappers or colors in a command line/terminal. This function may be called multiple times before all synchronous tasks complete.\n\n\n### Windows Settings\n\nKey          | Type   | Allowed                                  | Default                      | Description\n:--          | :--    | :--                                      | :--                          | :--\n`filePath`   | String | Any valid path or URL                    | **This is a required field** | This is the target the shortcut points to.\n`outputPath` | String | Any valid path to a folder               | `'%USERPROFILE%\\\\Desktop'`   | Path where the shortcut will be placed.\n`name`       | String | Any file system safe string              | Uses name from filePath      | The name of the shortcut file.\n`comment`    | String | Any string                               | Not used if not supplied     | Metadata file \"comment\" property. Description of what the shortcut would open.\n`icon`       | String | Valid path to file (ICO, EXE, or DLL)    | Uses OS default icon         | The image shown on the shortcut icon. You can also pass in an index if multiple icons, like `'C:\\\\file.exe,0'`\n`arguments`  | String | Any string                               | None                         | Additional arguments passed in to the end of your target `filePath`\n`windowMode` | String | `'normal'`, `'maximized'`, `'minimized'` | `'normal'`                   | How the window should be displayed by default\n`hotkey`     | String | Any string                               | None                         | A global hotkey to associate to opening this shortcut, like `'CTRL+ALT+F'`\n\n\n### Linux Settings\n\nKey          | Type    | Allowed                                  | Default                      | Description\n:--          | :--     | :--                                      | :--                          | :--\n`filePath`   | String  | Any valid path or URL                    | **This is a required field** | This is the target the shortcut points to. Must be a valid/existing folder if `type: 'Directory'`, or file if `type: 'Application'`.\n`outputPath` | String  | Any valid path to a folder               | Current user's desktop       | Path where the shortcut will be placed.\n`name`       | String  | Any file system safe string              | Uses name from filePath      | The name of the shortcut file.\n`comment`    | String  | Any string                               | Not used if not supplied     | Metadata file \"comment\" property. Description of what the shortcut would open.\n`icon`       | String  | Valid path to PNG or ICNS file           | Uses OS default icon         | The image shown on the shortcut icon. Preferably a 256x256 PNG.\n`type`       | String  | `'Application'`, `'Link'`, `'Directory'` | Based on `filePath`          | Type of shortcut. Defaults to `'Link'` if `filePath` starts with `'http://'` or `'https://'`. Defaults to `'Directory'` if filePath exists and is a folder. Defaults to Application otherwise.\n`terminal`   | Boolean | `true`, `false`                          | `false`                      | If true, will run in a terminal.\n`chmod`      | Boolean | `true`, `false`                          | `true`                       | If true, will apply a `chmod +x` (755) to the shortcut after creation to allow execution permission.\n\n\n### OSX Settings\n\nOSX will automatically inherit the icon of the target you point to. It doesn't care if you point to a folder, file, or application.\n\n**NOTE:** If `overwrite` is set to `false` and a matching file already exists, a `console.error` will occur to inform you of this, however `create-desktop-shortcuts` will still report successful. This `console.error` can be hidden by setting `verbose` to `false`, or using a `customLogger` to intercept it.\n\nKey          | Type    | Allowed                     | Default                      | Description\n:--          | :--     | :--                         | :--                          | :--\n`filePath`   | String  | Any valid path or URL       | **This is a required field** | This is the target the shortcut points to.\n`outputPath` | String  | Any valid path to a folder  | Current user's desktop       | Path where the shortcut will be placed.\n`name`       | String  | Any file system safe string | Uses name from filePath      | The name of the shortcut file.\n`overwrite`  | Boolean | `true`, `false`             | false                        | If true, will replace any existing file in the `outputPath` with matching `name`. See above note for more details.\n\n\n* * *\n\n\n## Credits\n\nAuthor: The Jared Wilcurt\n\nParts of the `windows.vbs` were copied/modified based on:\n\n * https://www.vbsedit.com/html/a239a3ac-e51c-4e70-859e-d2d8c2eb3135.asp\n * https://forums.techguy.org/threads/solved-vbscript-create-a-shortcut-within-a-folder.886401/\n\n\n* * *\n\n\n## How can you help improve this repo?\n\n* Report bugs in the GitHub issues\n* Request features\n* Fix reported bugs with a PR\n* Offer an async and sync mode, instead of just sync.\n  * Note: Make sure it can still run in older versions of NW.js\n* Help with any of the known issues listed below:\n\n\n* * *\n\n\n## Known issues\n\n1. **Windows:** If WScript does not like what is passed to it, it displays a Windows Dialog with an error on the line that failed. I have no idea how to turn that off, so I've just added in tons of validation checks to prevent anything from being passed in to it that could cause this. But may still occur if you pass in junk to it that gets by the validation checks.\n1. **Linux:** No real recourse if the script does not have permission to run `chmod` on Linux. You would just need to run it again with sudo or something. If you have ideas, create an issue or PR.\n1. **OSX:** I know of no way to set a custom icon image on OSX. It will just always use the same icon the executable had (or file type if linking to an `.html` file for example)\n1. **Windows/Linux:** May want to add in `overwrite` option for Windows and Linux too. This would require deleting the existing shortcut. Deleting files is something that each OS sucks at in different ways and would require pulling in something like `fs-extra` or similar dependency.\n","readmeFilename":"README.md"}