{"bin":{"ts-node":"dist/bin.js","ts-script":"dist/bin-script-deprecated.js","ts-node-script":"dist/bin-script.js","ts-node-transpile-only":"dist/bin-transpile.js"},"bugs":{"url":"https://github.com/TypeStrong/ts-node/issues"},"dist":{"shasum":"eee03764633b1234ddd37f8db9ec10b75ec7fb8d","tarball":"https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz","fileCount":35,"integrity":"sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==","signatures":[{"sig":"MEYCIQDd0oX5OD5sPtWX2PH/PHM3ZIzEEjU52zRWEiP+xZUHegIhAKRtSQK5u2Aw6Jo9xwkwsIZ2QaKsgs0cL3iOb170Asgr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":303760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJez9xtCRA9TVsSAnZWagAAO8kP/Asv+MDQu2ADPOJCf/vJ\nwJzqoFPOzL3tFmloPJ/gHi2uSxeQqThCWtG0+rsO3lbJG92gnBBSHFRVAczQ\nPGMZiqwc9uGe17B+mdKNCMRUiQ6N+xUSRv7xCbTdN/JCfK+aaQxDnBdpUUmp\nypSBct3MsMVVVwHo6v0yLywj76lHeF9AYCaE5/3MnAcwtUD7pyAhgo7ho9Ip\ntawY5TBQwV4cqG+hdwVigLjtLarvaaXr++jPMlkZ/0Bt3juQ1Lc4qeGdbylg\negBPIJet2IqKnSWFMIM2deNnYc73ZEjTknn4LHB6qNHl1/IPr63mQ8G5m3i3\ngagXtw8xeTWxaA+56A/hR+oQu1MpfpK7A60v1pEwlMJrLPDXllaXxftWELmk\nu9H3hrEvZoWB600ZxCpX6BqKDea1b94KDKORbqqx+heFCVvVPJIRX6gDEcx3\ney7z9vQUZ7geM8S/3gIBLZkSLB3FJkmZ1CYLmS30Jh3ehrt0OygB+NGwhbNs\nlqOKBAf0839PQh4xBN+6REbbQ907l7YN1Usx1D1mFDAG2qeDCOckSIQ7xPnG\nOnHLwgKyP+jyk+HssSgk85JxtM94P+p/Cts8dcmHq+U504rmdMUKP3diHGYc\ngBU5XQtHj7OjfStSrqeXgcITXaIZl2MgwGqK4vJa9mdyL9dxhLPohn2C1Vcm\nYHEn\r\n=d8jB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"ts-node","types":"dist/index.d.ts","author":{"url":"http://blakeembrey.me","name":"Blake Embrey","email":"hello@blakeembrey.com"},"readme":"# ![TypeScript Node](logo.svg?sanitize=true)\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n\n> TypeScript execution and REPL for node.js, with source map support. **Works with `typescript@>=2.7`**.\n\n### *Experimental ESM support*\n\nNative ESM support is currently experimental. For usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007).\n\n## Installation\n\n```sh\n# Locally in your project.\nnpm install -D typescript\nnpm install -D ts-node\n\n# Or globally with TypeScript.\nnpm install -g typescript\nnpm install -g ts-node\n```\n\n**Tip:** Installing modules locally allows you to control and share the versions through `package.json`. TS Node will always resolve the compiler from `cwd` before checking relative to its own installation.\n\n## Usage\n\n### Shell\n\n```sh\n# Execute a script as `node` + `tsc`.\nts-node script.ts\n\n# Starts a TypeScript REPL.\nts-node\n\n# Execute code with TypeScript.\nts-node -e 'console.log(\"Hello, world!\")'\n\n# Execute, and print, code with TypeScript.\nts-node -p -e '\"Hello, world!\"'\n\n# Pipe scripts to execute with TypeScript.\necho 'console.log(\"Hello, world!\")' | ts-node\n\n# Equivalent to ts-node --script-mode\nts-node-script scripts.ts\n\n# Equivalent to ts-node --transpile-only\nts-node-transpile-only scripts.ts\n```\n\n![TypeScript REPL](https://github.com/TypeStrong/ts-node/raw/master/screenshot.png)\n\n### Shebang\n\n```typescript\n#!/usr/bin/env ts-node-script\n\nconsole.log(\"Hello, world!\")\n```\n\n`ts-node-script` is recommended because it enables `--script-mode`, discovering `tsconfig.json` relative to the script's location instead of `process.cwd()`.  This makes scripts more portable.\n\nPassing CLI arguments via shebang is allowed on Mac but not Linux.  For example, the following will fail on Linux:\n\n```\n#!/usr/bin/env ts-node --script-mode --transpile-only --files\n// This shebang is not portable.  It only works on Mac\n```\n\n### Programmatic\n\nYou can require `ts-node` and register the loader for future requires by using `require('ts-node').register({ /* options */ })`. You can also use file shortcuts - `node -r ts-node/register` or `node -r ts-node/register/transpile-only` - depending on your preferences.\n\n**Note:** If you need to use advanced node.js CLI arguments (e.g. `--inspect`), use them with `node -r ts-node/register` instead of the `ts-node` CLI.\n\n#### Developers\n\n**TS Node** exports a `create()` function that can be used to initialize a TypeScript compiler that isn't registered to `require.extensions`, and it uses the same code as `register`.\n\n### Mocha\n\nMocha 6\n\n```sh\nmocha --require ts-node/register --watch-extensions ts,tsx \"test/**/*.{ts,tsx}\" [...args]\n```\n\n**Note:** `--watch-extensions` is only used in `--watch` mode.\n\nMocha 7\n\n```sh\nmocha --require ts-node/register --extensions ts,tsx --watch --watch-files src 'tests/**/*.{ts,tsx}' [...args]\n```\n\n### Tape\n\n```sh\nts-node node_modules/tape/bin/tape [...args]\n```\n\n### Gulp\n\n```sh\n# Create a `gulpfile.ts` and run `gulp`.\ngulp\n```\n\n### Visual Studio Code\n\nCreate a new node.js configuration, add `-r ts-node/register` to node args and move the `program` to the `args` list (so VS Code doesn't look for `outFiles`).\n\n```json\n{\n    \"type\": \"node\",\n    \"request\": \"launch\",\n    \"name\": \"Launch Program\",\n    \"runtimeArgs\": [\n        \"-r\",\n        \"ts-node/register\"\n    ],\n    \"args\": [\n        \"${workspaceFolder}/index.ts\"\n    ]\n}\n```\n\n**Note:** If you are using the `--project <tsconfig.json>` command line argument as per the [Configuration Options](#configuration-options), and want to apply this same behavior when launching in VS Code, add an \"env\" key into the launch configuration: `\"env\": { \"TS_NODE_PROJECT\": \"<tsconfig.json>\" }`.\n\n### IntelliJ (and WebStorm)\n\nCreate a new Node.js configuration and add `-r ts-node/register` to \"Node parameters.\"\n\n**Note:** If you are using the `--project <tsconfig.json>` command line argument as per the [Configuration Options](#configuration-options), and want to apply this same behavior when launching in IntelliJ, specify under \"Environment Variables\": `TS_NODE_PROJECT=<tsconfig.json>`.\n\n## How It Works\n\n**TypeScript Node** works by registering the TypeScript compiler for `.tsx?` and `.jsx?` (when `allowJs == true`) extensions. When node.js has an extension registered (via `require.extensions`), it will use the extension internally for module resolution. When an extension is unknown to node.js, it handles the file as `.js` (JavaScript). By default, **TypeScript Node** avoids compiling files in `/node_modules/` for three reasons:\n\n1. Modules should always be published in a format node.js can consume\n2. Transpiling the entire dependency tree will make your project slower\n3. Differing behaviours between TypeScript and node.js (e.g. ES2015 modules) can result in a project that works until you decide to support a feature natively from node.js\n\n**P.S.** This means if you don't register an extension, it is compiled as JavaScript. When `ts-node` is used with `allowJs`, JavaScript files are transpiled using the TypeScript compiler.\n\n## Loading `tsconfig.json`\n\n**Typescript Node** loads `tsconfig.json` automatically. Use `--skip-project` to skip loading the `tsconfig.json`.\n\nIt is resolved relative to `--dir` using [the same search behavior as `tsc`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).  In `--script-mode`, this is the directory containing the script.  Otherwise it is resolved relative to `process.cwd()`, which matches the behavior of `tsc`.\n\nUse `--project` to specify the path to your `tsconfig.json`, ignoring `--dir`.\n\n**Tip**: You can use `ts-node` together with [tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) to load modules according to the `paths` section in `tsconfig.json`.\n\n## Configuration Options\n\nYou can set options by passing them before the script path, via programmatic usage, via `tsconfig.json`, or via environment variables.\n\n```sh\nts-node --compiler ntypescript --project src/tsconfig.json hello-world.ts\n```\n\n**Note:** [`ntypescript`](https://github.com/TypeStrong/ntypescript#readme) is an example of a TypeScript-compatible `compiler`.\n\n### CLI Options\n\n`ts-node` supports `--print` (`-p`), `--eval` (`-e`), `--require` (`-r`) and `--interactive` (`-i`) similar to the [node.js CLI options](https://nodejs.org/api/cli.html).\n\n* `-h, --help` Prints the help text\n* `-v, --version` Prints the version. `-vv` prints node and typescript compiler versions, too\n* `-s, --script-mode` Resolve config relative to the directory of the passed script instead of the current directory. Changes default of `--dir`\n\n### CLI and Programmatic Options\n\n_The name of the environment variable and the option's default value are denoted in parentheses._\n\n* `-T, --transpile-only` Use TypeScript's faster `transpileModule` (`TS_NODE_TRANSPILE_ONLY`, default: `false`)\n* `-H, --compiler-host` Use TypeScript's compiler host API (`TS_NODE_COMPILER_HOST`, default: `false`)\n* `-I, --ignore [pattern]` Override the path patterns to skip compilation (`TS_NODE_IGNORE`, default: `/node_modules/`)\n* `-P, --project [path]` Path to TypeScript JSON project file (`TS_NODE_PROJECT`)\n* `-C, --compiler [name]` Specify a custom TypeScript compiler (`TS_NODE_COMPILER`, default: `typescript`)\n* `-D, --ignore-diagnostics [code]` Ignore TypeScript warnings by diagnostic code (`TS_NODE_IGNORE_DIAGNOSTICS`)\n* `-O, --compiler-options [opts]` JSON object to merge with compiler options (`TS_NODE_COMPILER_OPTIONS`)\n* `--dir` Specify working directory for config resolution (`TS_NODE_CWD`, default: `process.cwd()`, or `dirname(scriptPath)` if `--script-mode`)\n* `--scope` Scope compiler to files within `cwd` (`TS_NODE_SCOPE`, default: `false`)\n* `--files` Load `files`, `include` and `exclude` from `tsconfig.json` on startup (`TS_NODE_FILES`, default: `false`)\n* `--pretty` Use pretty diagnostic formatter (`TS_NODE_PRETTY`, default: `false`)\n* `--skip-project` Skip project config resolution and loading (`TS_NODE_SKIP_PROJECT`, default: `false`)\n* `--skip-ignore` Skip ignore checks (`TS_NODE_SKIP_IGNORE`, default: `false`)\n* `--emit` Emit output files into `.ts-node` directory (`TS_NODE_EMIT`, default: `false`)\n* `--prefer-ts-exts` Re-order file extensions so that TypeScript imports are preferred (`TS_NODE_PREFER_TS_EXTS`, default: `false`)\n* `--log-error` Logs TypeScript errors to stderr instead of throwing exceptions (`TS_NODE_LOG_ERROR`, default: `false`)\n\n### Programmatic-only Options\n\n* `transformers` `_ts.CustomTransformers | ((p: _ts.Program) => _ts.CustomTransformers)`: An object with transformers or a function that accepts a program and returns an transformers object to pass to TypeScript. Function isn't available with `transpileOnly` flag\n* `readFile`: Custom TypeScript-compatible file reading function\n* `fileExists`: Custom TypeScript-compatible file existence function\n\n### Options via tsconfig.json\n\nMost options can be specified by a `\"ts-node\"` object in `tsconfig.json` using their programmatic, camelCase names. For example, to enable `--transpile-only`:\n\n```json\n// tsconfig.json\n{\n  \"ts-node\": {\n    \"transpileOnly\": true\n  },\n  \"compilerOptions\": {}\n}\n```\n\nOur bundled [JSON schema](https://unpkg.com/browse/ts-node@8.8.2/tsconfig.schema.json) lists all compatible options.\n\n## SyntaxError\n\nAny error that is not a `TSError` is from node.js (e.g. `SyntaxError`), and cannot be fixed by TypeScript or `ts-node`. These are runtime issues with your code.\n\n### Import Statements\n\nCurrent node.js stable releases do not support ES modules. Additionally, `ts-node` does not have the required hooks into node.js to support ES modules. You will need to set `\"module\": \"commonjs\"` in your `tsconfig.json` for your code to work.\n\n## Help! My Types Are Missing!\n\n**TypeScript Node** does _not_ use `files`, `include` or `exclude`, by default. This is because a large majority projects do not use all of the files in a project directory (e.g. `Gulpfile.ts`, runtime vs tests) and parsing every file for types slows startup time. Instead, `ts-node` starts with the script file (e.g. `ts-node index.ts`) and TypeScript resolves dependencies based on imports and references.\n\nFor global definitions, you can use the `typeRoots` compiler option.  This requires that your type definitions be structured as type packages (not loose TypeScript definition files). More details on how this works can be found in the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types).\n\nExample `tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"typeRoots\" : [\"./node_modules/@types\", \"./typings\"]\n  }\n}\n```\n\nExample project structure:\n\n```text\n<project_root>/\n-- tsconfig.json\n-- typings/\n  -- <module_name>/\n    -- index.d.ts\n```\n\nExample module declaration file:\n\n```typescript\ndeclare module '<module_name>' {\n    // module definitions go here\n}\n```\n\nFor module definitions, you can use [`paths`](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping):\n\n```json\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"custom-module-type\": [\"types/custom-module-type\"]\n    }\n  }\n}\n```\n\nAn alternative approach for definitions of third-party libraries are [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). This may be helpful if you prefer not to change your TypeScript `compilerOptions` or structure your custom type definitions when using `typeRoots`. Below is an example of the triple-slash directive as a relative path within your project:\n\n```typescript\n/// <reference types=\"./types/untyped_js_lib\" />\nimport UntypedJsLib from \"untyped_js_lib\"\n```\n\n**Tip:** If you _must_ use `files`, `include`, or `exclude`, enable `--files` flags or set `TS_NODE_FILES=true`.\n\n## Watching and Restarting\n\n**TypeScript Node** compiles source code via `require()`, watching files and code reloads are out of scope for the project. If you want to restart the `ts-node` process on file change, existing node.js tools such as [nodemon](https://github.com/remy/nodemon), [onchange](https://github.com/Qard/onchange) and [node-dev](https://github.com/fgnass/node-dev) work.\n\nThere's also [`ts-node-dev`](https://github.com/whitecolor/ts-node-dev), a modified version of [`node-dev`](https://github.com/fgnass/node-dev) using `ts-node` for compilation and won't restart the process on file change.\n\n## License\n\nMIT\n\n[npm-image]: https://img.shields.io/npm/v/ts-node.svg?style=flat\n[npm-url]: https://npmjs.org/package/ts-node\n[downloads-image]: https://img.shields.io/npm/dm/ts-node.svg?style=flat\n[downloads-url]: https://npmjs.org/package/ts-node\n[travis-image]: https://img.shields.io/travis/TypeStrong/ts-node.svg?style=flat\n[travis-url]: https://travis-ci.org/TypeStrong/ts-node\n[coveralls-image]: https://img.shields.io/coveralls/TypeStrong/ts-node.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/TypeStrong/ts-node?branch=master\n","engines":{"node":">=6.0.0"},"license":"MIT","scripts":{"lint":"tslint \"src/**/*.ts\" --project tsconfig.json","test":"npm run build && npm run lint && npm run test-cov","build":"npm run build-nopack && npm run build-pack","clean":"rimraf dist && rimraf tsconfig.schema.json && rimraf tsconfig.schemastore-schema.json && rimraf tests/ts-node-packed.tgz","prepare":"npm run build-nopack","lint-fix":"tslint \"src/**/*.ts\" --project tsconfig.json --fix","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- \"dist/**/*.spec.js\" -R spec --bail","build-tsc":"tsc","test-spec":"mocha dist/**/*.spec.js -R spec --bail","build-pack":"node ./scripts/build-pack.js","build-nopack":"npm run clean && npm run build-tsc && npm run build-configSchema","build-configSchema":"typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema"},"_npmUser":{"name":"cspotcode","email":"cspotcode@gmail.com"},"homepage":"https://github.com/TypeStrong/ts-node","keywords":["typescript","node","runtime","environment","ts","compiler"],"repository":{"url":"git://github.com/TypeStrong/ts-node.git","type":"git"},"_npmVersion":"6.14.4","description":"TypeScript execution environment and REPL for node.js, with source map support","directories":{},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"},{"name":"cspotcode","email":"cspotcode@gmail.com"}],"_nodeVersion":"14.2.0","dependencies":{"yn":"3.1.1","arg":"^4.1.0","diff":"^4.0.1","make-error":"^1.1.1","source-map-support":"^0.5.17"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.0.1","axios":"^0.19.0","mocha":"^6.2.2","react":"^16.0.0","rimraf":"^3.0.0","semver":"^7.1.3","tslint":"^6.1.0","istanbul":"^0.4.0","proxyquire":"^2.0.0","typescript":"3.8.3","@types/chai":"^4.0.4","@types/diff":"^4.0.2","@types/node":"13.13.5","ntypescript":"^1.201507091536.1","@types/mocha":"^5.2.7","@types/react":"^16.0.2","@types/semver":"^7.1.0","util.promisify":"^1.0.1","@types/proxyquire":"^1.3.28","tslint-config-standard":"^9.0.0","typescript-json-schema":"^0.42.0","@types/source-map-support":"^0.5.0"},"peerDependencies":{"typescript":">=2.7"},"_npmOperationalInternal":{"tmp":"tmp/ts-node_8.10.2_1590680685430_0.6133397237053411","host":"s3://npm-registry-packages"},"_id":"ts-node@8.10.2","version":"8.10.2"}