package/LICENSE000644 000000 000000 00000002056 03560116604 011630 0ustar00000000 000000 MIT License Copyright (c) 2021 Zoltan Kochan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. package/index.js000644 000000 000000 00000000362 03560116604 012266 0ustar00000000 000000 'use strict' const path = require('path') let cmdExtension if (process.env.PATHEXT) { cmdExtension = process.env.PATHEXT .split(path.delimiter) .find(ext => ext.toUpperCase() === '.CMD') } module.exports = cmdExtension || '.cmd' package/package.json000644 000000 000000 00000000722 03560116604 013107 0ustar00000000 000000 { "name": "cmd-extension", "version": "1.0.2", "description": "Gets the right command file extension on Windows", "main": "index.js", "files": [ "index.js", "index.d.ts" ], "engines": { "node": ">=10" }, "repository": "https://github.com/zkochan/packages/tree/master/cmd-extension", "author": { "name": "Zoltan Kochan" }, "license": "MIT", "homepage": "https://github.com/zkochan/packages/tree/master/cmd-extension#readme" }package/README.md000644 000000 000000 00000000657 03560116604 012107 0ustar00000000 000000 # cmd-extension > Gets the right command file extension on Windows [![npm version](https://img.shields.io/npm/v/cmd-extension.svg)](https://www.npmjs.com/package/cmd-extension) ## Installation ```sh add cmd-extension ``` ## Usage ```js 'use strict' const CMD_EXTENSION = require('cmd-extension') console.log(CMD_EXTENSION) //> .CMD ``` ## License [MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io) package/index.d.ts000644 000000 000000 00000000071 03560116604 012517 0ustar00000000 000000 declare const cmdExtension: string export = cmdExtension