├── tests ├── data │ ├── bin │ │ ├── hello_world │ │ └── goodbye_world │ ├── bin_1 │ │ └── hello_mike │ └── bin_2 │ │ └── hello_john └── lookpath.spec.ts ├── .gitignore ├── .npmignore ├── .github ├── dependabot.yml ├── FUNDING.yml └── workflows │ ├── node.js.yml │ └── codeql-analysis.yml ├── .eslintrc.yml ├── bin └── lookpath.js ├── LICENSE ├── package.json ├── README.md ├── src └── index.ts └── tsconfig.json /tests/data/bin/hello_world: -------------------------------------------------------------------------------- 1 | echo 'Hello!' -------------------------------------------------------------------------------- /tests/data/bin/goodbye_world: -------------------------------------------------------------------------------- 1 | echo 'Goodbye!' 2 | -------------------------------------------------------------------------------- /tests/data/bin_1/hello_mike: -------------------------------------------------------------------------------- 1 | echo 'Hello, Mike!' -------------------------------------------------------------------------------- /tests/data/bin_2/hello_john: -------------------------------------------------------------------------------- 1 | echo 'Hello, John!' -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | .vscode 4 | coverage -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .circleci 3 | .eslintrc.yml 4 | .github 5 | .gitignore 6 | tests 7 | coverage 8 | node_modules 9 | tsconfig.json -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: / 5 | schedule: 6 | interval: monthly 7 | target-branch: main 8 | assignees: 9 | - otiai10 -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | parser: '@typescript-eslint/parser' 2 | plugins: ['@typescript-eslint'] 3 | extends: ['plugin:@typescript-eslint/recommended'] 4 | rules: 5 | '@typescript-eslint/explicit-function-return-type': 0 6 | -------------------------------------------------------------------------------- /bin/lookpath.js: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | const [ , , arg] = process.argv; 3 | require('../lib').lookpath(arg || '').then(found => { 4 | if (!found) throw new Error(`Not found: ${arg}`); 5 | console.log(found); 6 | }).catch(err => { 7 | console.error(err.message); 8 | process.exit(1); 9 | }); -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [otiai10] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | name: Node.js CI 2 | 3 | on: 4 | push: 5 | branches: [ main, develop ] 6 | pull_request: 7 | branches: [ main, develop ] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | os: [ubuntu-latest, macos-latest, windows-latest] 14 | node-version: [16.x, 18.x, 20.x] 15 | runs-on: ${{ matrix.os }} 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Use Node.js ${{ matrix.node-version }} 19 | uses: actions/setup-node@v4 20 | with: 21 | node-version: ${{ matrix.node-version }} 22 | - run: npm ci 23 | - run: npm run build 24 | - run: npm run validate 25 | - run: npm run lint 26 | - run: npm test -- --coverage 27 | - uses: codecov/codecov-action@v4 28 | with: 29 | file: ./coverage/coverage-final.json 30 | token: ${{ secrets.CODECOV_TOKEN }} 31 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | schedule: 9 | - cron: '36 19 1 */2 *' 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: ubuntu-latest 15 | permissions: 16 | actions: read 17 | contents: read 18 | security-events: write 19 | 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | language: [ 'javascript' ] 24 | steps: 25 | - name: Checkout repository 26 | uses: actions/checkout@v4 27 | 28 | - name: Initialize CodeQL 29 | uses: github/codeql-action/init@v3 30 | with: 31 | languages: ${{ matrix.language }} 32 | 33 | - name: Autobuild 34 | uses: github/codeql-action/autobuild@v3 35 | 36 | - name: Perform CodeQL Analysis 37 | uses: github/codeql-action/analyze@v3 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Hiromu OCHIAI (otiai10) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lookpath", 3 | "version": "1.2.2", 4 | "description": "The minimum and most straightforward way to check if command exists and where the executable is.", 5 | "engines": { 6 | "npm": ">=6.13.4" 7 | }, 8 | "main": "./lib/index.js", 9 | "bin": { 10 | "lookpath": "bin/lookpath.js" 11 | }, 12 | "types": "./lib/index.d.ts", 13 | "scripts": { 14 | "build": "rm -rf ./lib && tsc", 15 | "lint": "eslint ./src/index.ts ./tests/lookpath.spec.ts", 16 | "test": "jest", 17 | "validate": "npm run build && node ./bin/lookpath.js npm", 18 | "release": "npm run build && npm run validate && npm publish" 19 | }, 20 | "author": "otiai10", 21 | "license": "MIT", 22 | "repository": { 23 | "type": "git", 24 | "url": "git+https://github.com/otiai10/lookpath.git" 25 | }, 26 | "keywords": [ 27 | "exec.LookPath", 28 | "command", 29 | "exists" 30 | ], 31 | "bugs": { 32 | "url": "https://github.com/otiai10/lookpath/issues" 33 | }, 34 | "homepage": "https://github.com/otiai10/lookpath#readme", 35 | "devDependencies": { 36 | "@types/jest": "^27.0.2", 37 | "@types/node": "^22.0.2", 38 | "@typescript-eslint/eslint-plugin": "^4.31.2", 39 | "@typescript-eslint/parser": "^4.31.2", 40 | "eslint": "^7.32.0", 41 | "jest": "^27.2.2", 42 | "ts-jest": "^27.0.5", 43 | "typescript": "^4.4.3" 44 | }, 45 | "jest": { 46 | "transform": { 47 | "^.+\\.tsx?$": "ts-jest" 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # lookpath 2 | 3 | [![npm version](https://badge.fury.io/js/lookpath.svg)](https://badge.fury.io/js/lookpath) 4 | [![npm download](https://img.shields.io/npm/dt/lookpath.svg)](https://www.npmjs.com/package/lookpath) 5 | [![Node.js CI](https://github.com/otiai10/lookpath/workflows/Node.js%20CI/badge.svg)](https://github.com/otiai10/lookpath/actions/) 6 | [![CodeQL](https://github.com/otiai10/lookpath/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/otiai10/lookpath/actions/workflows/codeql-analysis.yml) 7 | [![codecov](https://codecov.io/gh/otiai10/lookpath/branch/master/graph/badge.svg)](https://codecov.io/gh/otiai10/lookpath) 8 | [![Maintainability](https://api.codeclimate.com/v1/badges/1cc9237695a7bd8e3d60/maintainability)](https://codeclimate.com/github/otiai10/lookpath/maintainability) 9 | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fotiai10%2Flookpath.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fotiai10%2Flookpath?ref=badge_shield) 10 | 11 | To check if the command exists and where the executable file is, **WITHOUT** using `child_process`. 12 | 13 | ``` 14 | npm install lookpath 15 | ``` 16 | 17 | # Example usage 18 | 19 | ```js 20 | const { lookpath } = require('lookpath'); 21 | 22 | const p = await lookpath('bash'); 23 | // "/bin/bash", otherwise "undefined" 24 | ``` 25 | 26 | # Advanced usage 27 | 28 | ```js 29 | const p = await lookpath('bash', { 30 | include: ['/home/hiromu/.bin'], 31 | exclude: ['/mnt'] 32 | }); 33 | // include: Do scan also under `~/.bin` 34 | // exclude: Do NOT scan under `/mnt` 35 | ``` 36 | 37 | # Motivation 38 | 39 | - I don't want to spawn `child_process` in order to kick `which`, `where`, `whereis`, or `command -v`. 40 | - [node.js - Node - check existence of command in path - Stack Overflow](https://stackoverflow.com/questions/34953168/node-check-existence-of-command-in-path/) 41 | - [Node.js: Check if a command exists - Gist](https://gist.github.com/jmptable/7a3aa580efffdef50fa9f0dd3d068d6f) 42 | - [mathisonian/command-exists: node module to check if a command-line command exists - GitHub](https://github.com/mathisonian/command-exists) 43 | - then I checked Go implementation of [`exec.LookPath`](https://golang.org/pkg/os/exec/#LookPath). 44 | - [src/os/exec/lp_unix.go - The Go Programming Language](https://golang.org/src/os/exec/lp_unix.go?s=928:970#L24) 45 | - so I concluded that scanning under `$PATH` or `$Path` is the best straightforward way to check if the command exists. 46 | 47 | 48 | # Issues 49 | 50 | - https://github.com/otiai10/lookpath/issues 51 | 52 | Any feedback would be appreciated ;) 53 | 54 | 55 | # License 56 | 57 | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fotiai10%2Flookpath.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fotiai10%2Flookpath?ref=badge_large) -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import * as path from 'path'; 3 | 4 | const isWindows = /^win/i.test(process.platform); 5 | 6 | /** 7 | * Sometimes, people want to look for local executable files 8 | * which are specified with either relative or absolute file path. 9 | * @private 10 | * @param cmd 11 | * @return {string} An absolute path of given command, or undefined. 12 | */ 13 | const isFilepath = (cmd: string): string | undefined => { 14 | return cmd.includes(path.sep) ? path.resolve(cmd) : undefined; 15 | } 16 | 17 | /** 18 | * Just promisifies "fs.access" 19 | * @private 20 | * @param {string} fpath An absolute file path with an applicable extension appended. 21 | * @return {Promise} Resolves absolute path or empty string. 22 | */ 23 | const access = (fpath: string): Promise => { 24 | return new Promise(resolve => fs.access(fpath, fs.constants.X_OK, err => resolve(err ? undefined : fpath))); 25 | }; 26 | 27 | /** 28 | * Resolves if the given file is executable or not, regarding "PATHEXT" to be applied. 29 | * @private 30 | * @param {string} abspath A file path to be checked. 31 | * @return {Promise} Resolves the absolute file path just checked, or undefined. 32 | */ 33 | const isExecutable = async (abspath: string, opt: LookPathOption = {}): Promise => { 34 | const envvars = opt.env || process.env; 35 | const exts = (envvars.PATHEXT || '').split(path.delimiter).concat(''); 36 | const bins = await Promise.all(exts.map(ext => access(abspath + ext))); 37 | return bins.find(bin => !!bin); 38 | }; 39 | 40 | /** 41 | * Returns a list of directories on which the target command should be looked for. 42 | * @private 43 | * @param {string[]} opt.include Will be added to "PATH" env. 44 | * @param {string[]} opt.exclude Will be filtered from "PATH" env. 45 | * @return {string[]} Directories to dig into. 46 | */ 47 | const getDirsToWalkThrough = (opt: LookPathOption): string[] => { 48 | const envvars = opt.env || process.env; 49 | const envname = isWindows ? 'Path' : 'PATH'; 50 | return (envvars[envname] || '').split(path.delimiter).concat(opt.include || []).filter(p => !(opt.exclude || []).includes(p)); 51 | }; 52 | 53 | /** 54 | * Returns async promise with absolute file path of given command, 55 | * and resolves with undefined if the command not found. 56 | * @param {string} command Command name to look for. 57 | * @param {LookPathOption} opt Options for lookpath. 58 | * @return {Promise} Resolves absolute file path, or undefined if not found. 59 | */ 60 | export async function lookpath(command: string, opt: LookPathOption = {}): Promise { 61 | 62 | const directpath = isFilepath(command); 63 | if (directpath) return isExecutable(directpath, opt); 64 | 65 | const dirs = getDirsToWalkThrough(opt); 66 | const bins = await Promise.all(dirs.map(dir => isExecutable(path.join(dir, command), opt))); 67 | return bins.find(bin => !!bin); 68 | } 69 | 70 | /** 71 | * Options for lookpath. 72 | */ 73 | export interface LookPathOption { 74 | /** 75 | * Additional pathes to look for, would be dealt same as PATH env. 76 | * Example: ['/tmp/bin', 'usr/local/bin'] 77 | */ 78 | include?: string[]; 79 | /** 80 | * Pathes to exclude to look for. 81 | * Example: ['/mnt'] 82 | */ 83 | exclude?: string[]; 84 | /** 85 | * Set of env var to be used ON BEHALF OF the existing env of your runtime. 86 | * If `include` or `exclude` are given, they will be applied to this env set. 87 | */ 88 | env?: NodeJS.ProcessEnv; 89 | } 90 | -------------------------------------------------------------------------------- /tests/lookpath.spec.ts: -------------------------------------------------------------------------------- 1 | import { lookpath } from '../src/index'; 2 | import * as path from 'path'; 3 | import { promises as fs } from 'fs'; 4 | 5 | 6 | describe('lookpath', () => { 7 | 8 | const isWindows = /^win/i.test(process.platform); 9 | 10 | beforeAll(async () => { 11 | await fs.chmod(path.join('.', 'tests', 'data', 'bin', 'goodbye_world'), 0o644); 12 | }); 13 | 14 | it('should return undefined if the command is NOT existing', async () => { 15 | const abspathNotExisting = await lookpath('unexistingcommand'); 16 | expect(abspathNotExisting).toBeUndefined(); 17 | }); 18 | 19 | it('should detect absolute path if it exists', async () => { 20 | const abspathSurelyExisting = await lookpath('node'); 21 | expect(abspathSurelyExisting).not.toBeUndefined(); 22 | }); 23 | 24 | it('should accept additional path by option', async () => { 25 | const withoutAdditionalPath = await lookpath('hello_world'); 26 | expect(withoutAdditionalPath).toBeUndefined(); 27 | const additionalPath = path.join(__dirname, 'data', 'bin') 28 | const withAdditionalPath = await lookpath('hello_world', { include: [additionalPath] }) 29 | expect(withAdditionalPath).not.toBeUndefined(); 30 | }); 31 | 32 | it('should exclude path by option', async () => { 33 | process.env['PATH'] = [process.env['PATH'], path.join(__dirname, 'data', 'bin')].join(path.delimiter); 34 | process.env['Path'] = [process.env['Path'], path.join(__dirname, 'data', 'bin')].join(path.delimiter); 35 | const withoutExclude = await lookpath('hello_world'); 36 | expect(withoutExclude).not.toBeUndefined(); 37 | const withExclude = await lookpath('hello_world', {exclude: [path.join(__dirname, 'data', 'bin')]}); 38 | expect(withExclude).toBeUndefined(); 39 | }); 40 | 41 | it('should accept a relative or absolute file path', async () => { 42 | const withRelative = await lookpath(path.join('.', 'tests', 'data', 'bin', 'hello_world')); 43 | expect(withRelative).not.toBeUndefined(); 44 | const withAbsolute = await lookpath(path.join(__dirname, 'data', 'bin', 'hello_world')); 45 | expect(withAbsolute).not.toBeUndefined(); 46 | }); 47 | 48 | it('should return undefined if the file is NOT executable', async () => { 49 | if (!/^win/i.test(process.platform)) { 50 | const notExecutable = await lookpath(path.join('.', 'tests', 'data', 'bin', 'goodbye_world')); 51 | expect(notExecutable).toBeUndefined(); 52 | } 53 | }); 54 | 55 | it('should be case-INsensitive on Windows & macOS', async () => { 56 | if (!/^(win|darwin)/i.test(process.platform)) return; 57 | let result; 58 | const include = [path.join(__dirname, 'data', 'bin')]; 59 | result = await lookpath('HELLO_WORLD', { include }); 60 | expect(result).not.toBeUndefined(); 61 | result = await lookpath('HELLO_WORLD_NOTFOUND', { include }); 62 | expect(result).toBeUndefined(); 63 | result = await lookpath('PING'); 64 | expect(result).not.toBeUndefined(); 65 | if (isWindows) { 66 | result = await lookpath('ping.exe'); 67 | expect(result).not.toBeUndefined(); 68 | result = await lookpath('PING.EXE'); 69 | expect(result).not.toBeUndefined(); 70 | } 71 | }); 72 | 73 | it('should accept env option to be used instead of process.env of runtime', async () => { 74 | const env: NodeJS.ProcessEnv = { 75 | [isWindows ? "Path" : "PATH"]: [ 76 | path.join(__dirname, 'data', 'bin'), 77 | path.join(__dirname, 'data', 'bin_1'), 78 | path.join(__dirname, 'data', 'bin_2'), 79 | ].join(path.delimiter), 80 | }; 81 | let result = await lookpath('node', { env }); 82 | expect(result).toBeUndefined(); 83 | result = await lookpath('node'); 84 | expect(result).not.toBeUndefined(); 85 | result = await lookpath('hello_mike', { env }); 86 | expect(result).not.toBeUndefined(); 87 | }); 88 | }); 89 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | "./lib", 4 | "./tests", 5 | "./node_modules", 6 | ], 7 | "compilerOptions": { 8 | /* Basic Options */ 9 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ 10 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 11 | // "lib": [], /* Specify library files to be included in the compilation. */ 12 | // "allowJs": true, /* Allow javascript files to be compiled. */ 13 | // "checkJs": true, /* Report errors in .js files. */ 14 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 15 | "declaration": true, /* Generates corresponding '.d.ts' file. */ 16 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 17 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 18 | // "outFile": "./", /* Concatenate and emit output to single file. */ 19 | "outDir": "./lib", /* Redirect output structure to the directory. */ 20 | "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 21 | // "composite": true, /* Enable project compilation */ 22 | // "incremental": true, /* Enable incremental compilation */ 23 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 24 | // "removeComments": true, /* Do not emit comments to output. */ 25 | // "noEmit": true, /* Do not emit outputs. */ 26 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 27 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 28 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 29 | 30 | /* Strict Type-Checking Options */ 31 | "strict": true, /* Enable all strict type-checking options. */ 32 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 33 | // "strictNullChecks": true, /* Enable strict null checks. */ 34 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 35 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 36 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 37 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 38 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 39 | 40 | /* Additional Checks */ 41 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 42 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 43 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 44 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 45 | 46 | /* Module Resolution Options */ 47 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 48 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 49 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 50 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 51 | // "typeRoots": [], /* List of folders to include type definitions from. */ 52 | // "types": [], /* Type declaration files to be included in compilation. */ 53 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 54 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 55 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 56 | 57 | /* Source Map Options */ 58 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 60 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 61 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 62 | 63 | /* Experimental Options */ 64 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 65 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 66 | } 67 | } 68 | --------------------------------------------------------------------------------