Socket
Socket
Sign inDemoInstall

ts-node

Package Overview
Dependencies
Maintainers
1
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-node - npm Package Compare versions

Comparing version 1.5.2 to 1.6.0

4

dist/_bin.js

@@ -96,4 +96,4 @@ "use strict";

project: argv.project,
ignore: typeof argv.ignore === 'boolean' ? argv.ignore : arrify(argv.ignore),
ignoreWarnings: arrify(argv.ignoreWarnings),
ignore: argv.ignore,
ignoreWarnings: argv.ignoreWarnings,
disableWarnings: argv.disableWarnings,

@@ -100,0 +100,0 @@ compilerOptions: index_1.parse(argv.compilerOptions),

@@ -29,4 +29,4 @@ import { BaseError } from 'make-error';

project?: boolean | string;
ignore?: boolean | string[];
ignoreWarnings?: Array<number | string>;
ignore?: boolean | string | string[];
ignoreWarnings?: number | string | Array<number | string>;
disableWarnings?: boolean | null;

@@ -41,3 +41,3 @@ getFile?: (fileName: string) => string;

}
export declare function split(value: string | undefined): string[];
export declare function split(value: string | undefined): string[] | undefined;
export declare function parse(value: string | undefined): any;

@@ -44,0 +44,0 @@ export declare function slash(value: string): string;

@@ -15,2 +15,3 @@ "use strict";

var yn = require('yn');
var arrify = require('arrify');
var make_error_1 = require('make-error');

@@ -34,3 +35,3 @@ var tsconfig_1 = require('tsconfig');

function split(value) {
return value ? value.split(/ *, */g) : [];
return value ? value.split(/ *, */g) : undefined;
}

@@ -49,3 +50,3 @@ exports.split = split;

var compiler = options.compiler || 'typescript';
var ignoreWarnings = (options.ignoreWarnings || DEFAULTS.ignoreWarnings).map(Number);
var ignoreWarnings = arrify(options.ignoreWarnings || DEFAULTS.ignoreWarnings || []).map(Number);
var disableWarnings = !!(options.disableWarnings == null ? DEFAULTS.disableWarnings : options.disableWarnings);

@@ -61,3 +62,3 @@ var getFile = options.getFile || DEFAULTS.getFile;

var result;
var ignore = ((typeof options.ignore === 'boolean' ?
var ignore = arrify((typeof options.ignore === 'boolean' ?
(options.ignore === false ? [] : undefined) :

@@ -204,7 +205,3 @@ (options.ignore || DEFAULTS.ignore)) ||

var relname = slash(filename);
var extension = path_1.extname(filename);
if (!extension || service().extensions.indexOf(extension) > -1) {
return ignore.some(function (x) { return x.test(relname); });
}
return false;
return ignore.some(function (x) { return x.test(relname); });
}

@@ -211,0 +208,0 @@ function registerExtension(ext, ignore, service, originalHandler) {

{
"name": "ts-node",
"version": "1.5.2",
"version": "1.6.0",
"preferGlobal": true,

@@ -5,0 +5,0 @@ "description": "TypeScript execution environment and REPL for node",

@@ -25,3 +25,3 @@ # TypeScript Node

* Uses source maps
* Loads from `tsconfig.json`
* Loads compiler options and `.d.ts` files from `tsconfig.json`

@@ -68,7 +68,13 @@ ## Usage

### Loading `tsconfig.json`
## How It Works
**TypeScript Node** works by registering the TypeScript compiler for the `.ts`, `.tsx` and - when `allowJs` is enabled - `.js` extensions. When node.js has a file extension registered (the `require.extensions` object), it will use the extension internally with module resolution. By default, when an extension is unknown to node.js, it will fallback to handling the file as `.js` (JavaScript).
**P.S.** This means that if you don't register an extension, it'll be compiled as JavaScript. When `ts-node` is used with `allowJs`, JavaScript files are transpiled using the TypeScript compiler.
## Loading `tsconfig.json`
**Typescript Node** uses `tsconfig.json` automatically, use `-n` to skip loading `tsconfig.json`.
### Configuration Options
## Configuration Options

@@ -81,4 +87,5 @@ You can set options by passing them in before the script.

* **--project, -P** Path to resolve `tsconfig.json` from (or `false`) (also `process.env.TS_NODE_PROJECT`)
* **--project, -P** Path to resolve `tsconfig.json` from (or `false` to disable) (also `process.env.TS_NODE_PROJECT`)
* **--compiler, -C** Use a custom, require-able TypeScript compiler compatible with `typescript@>=1.5.0-alpha` (also `process.env.TS_NODE_COMPILER`)
* **--ignore** Specify an array of regular expression strings for `ts-node` to skip compiling as TypeScript (defaults to `/node_modules/`, `false` to disable) (also `process.env.TS_NODE_IGNORE`)
* **--ignoreWarnings, -I** Set an array of TypeScript diagnostic codes to ignore (also `process.env.TS_NODE_IGNORE_WARNINGS`)

@@ -92,3 +99,3 @@ * **--disableWarnings, -D** Ignore all TypeScript errors (also `process.env.TS_NODE_DISABLE_WARNINGS`)

### Programmatic Usage
## Programmatic Usage

@@ -95,0 +102,0 @@ ```js

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc