云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
sync
/
jcore
/
web
/
front_end
/
node_modules
/
cmd-shim-hotfix
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
lib
2024-07-22 17:40:27
1.61 KB
index.js
2024-07-14 16:17:00
7.34 KB
LICENSE
2024-07-14 16:17:00
756 B
package.json
2024-07-14 16:17:00
1.54 KB
README.md
2024-07-14 16:17:00
1.05 KB
# cmd-shim The cmd-shim used in npm to create executable scripts on Windows, since symlinks are not suitable for this purpose there. On Unix systems, you should use a symbolic link instead. [](https://travis-ci.org/npm/cmd-shim) [](https://david-dm.org/npm/cmd-shim) [](https://www.npmjs.com/package/cmd-shim) ## Installation ``` npm install cmd-shim ``` ## API ### cmdShim(from, to, cb) Create a cmd shim at `to` for the command line program at `from`. e.g. ```javascript var cmdShim = require('cmd-shim'); cmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) { if (err) throw err; }); ``` ### cmdShim.ifExists(from, to, cb) The same as above, but will just continue if the file does not exist. Source: ```javascript function cmdShimIfExists (from, to, cb) { fs.stat(from, function (er) { if (er) return cb() cmdShim(from, to, cb) }) } ```
2025-09-03 16:31:38 Wednesday 216.73.216.38 Runningtime:0.015s Mem:1.48 MB