]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/README.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / cmd-shim / README.md
1 # cmd-shim
2
3 The cmd-shim used in npm to create executable scripts on Windows,
4 since symlinks are not suitable for this purpose there.
5
6 On Unix systems, you should use a symbolic link instead.
7
8 [![Build Status](https://img.shields.io/travis/ForbesLindesay/cmd-shim/master.svg)](https://travis-ci.org/ForbesLindesay/cmd-shim)
9 [![Dependency Status](https://img.shields.io/david/ForbesLindesay/cmd-shim.svg)](https://david-dm.org/ForbesLindesay/cmd-shim)
10 [![NPM version](https://img.shields.io/npm/v/cmd-shim.svg)](https://www.npmjs.com/package/cmd-shim)
11
12 ## Installation
13
14 ```
15 npm install cmd-shim
16 ```
17
18 ## API
19
20 ### cmdShim(from, to, cb)
21
22 Create a cmd shim at `to` for the command line program at `from`.
23 e.g.
24
25 ```javascript
26 var cmdShim = require('cmd-shim');
27 cmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {
28   if (err) throw err;
29 });
30 ```
31
32 ### cmdShim.ifExists(from, to, cb)
33
34 The same as above, but will just continue if the file does not exist.
35 Source:
36
37 ```javascript
38 function cmdShimIfExists (from, to, cb) {
39   fs.stat(from, function (er) {
40     if (er) return cb()
41     cmdShim(from, to, cb)
42   })
43 }
44 ```