🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

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

to
3.0.3

2

dist/_bin.js

@@ -195,3 +195,3 @@ "use strict";

var undo = appendEval('');
repl.on('reset', function () { return undo(); });
repl.on('reset', undo);
repl.defineCommand('type', {

@@ -198,0 +198,0 @@ help: 'Check the type of a TypeScript identifier',

@@ -94,8 +94,2 @@ "use strict";

}
if (config.options.target === undefined) {
config.options.target = ts.ScriptTarget.ES5;
}
if (config.options.module === undefined) {
config.options.module = ts.ModuleKind.CommonJS;
}
if (config.options.allowJs) {

@@ -222,2 +216,14 @@ extensions.push('.js');

}
function fixConfig(config, ts) {
delete config.options.out;
delete config.options.outFile;
delete config.options.declarationDir;
if (config.options.target === undefined) {
config.options.target = ts.ScriptTarget.ES5;
}
if (config.options.module === undefined) {
config.options.module = ts.ModuleKind.CommonJS;
}
return config;
}
function readConfig(compilerOptions, project, cwd, ts) {

@@ -233,12 +239,9 @@ var result = tsconfig_1.loadSync(cwd, typeof project === 'string' ? project : undefined);

});
delete result.config.compilerOptions.out;
delete result.config.compilerOptions.outFile;
delete result.config.compilerOptions.declarationDir;
var configPath = result.path && normalizeSlashes(result.path);
var basePath = configPath ? path_1.dirname(configPath) : normalizeSlashes(cwd);
if (typeof ts.parseConfigFile === 'function') {
return ts.parseConfigFile(result.config, ts.sys, basePath);
return fixConfig(ts.parseConfigFile(result.config, ts.sys, basePath), ts);
}
if (typeof ts.parseJsonConfigFileContent === 'function') {
return ts.parseJsonConfigFileContent(result.config, ts.sys, basePath, undefined, configPath);
return fixConfig(ts.parseJsonConfigFileContent(result.config, ts.sys, basePath, undefined, configPath), ts);
}

@@ -245,0 +248,0 @@ throw new TypeError('Could not find a compatible `parseConfigFile` function');

@@ -21,3 +21,3 @@ "use strict";

child_process_1.exec(BIN_EXEC + " tests/hello-world", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('Hello, world!\n');

@@ -29,3 +29,3 @@ return done();

child_process_1.exec(BIN_EXEC + " \"" + path_1.join(testDir, 'hello-world') + "\"", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('Hello, world!\n');

@@ -37,3 +37,3 @@ return done();

child_process_1.exec(BIN_EXEC + " -p \"import { example } from './tests/complex/index';example()\"", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('example\n');

@@ -50,3 +50,3 @@ return done();

].join(' '), function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('hello world\n');

@@ -59,3 +59,3 @@ return done();

child_process_1.exec(BIN_EXEC + " -e \"import * as m from './tests/module';console.log(m.example('test'))\"", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('TEST\n');

@@ -108,3 +108,3 @@ return done();

var cp = child_process_1.exec(BIN_EXEC, function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('hello\n');

@@ -117,3 +117,3 @@ return done();

var cp = child_process_1.exec(BIN_EXEC + " -p", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('true\n');

@@ -126,3 +126,3 @@ return done();

var cp = child_process_1.exec(BIN_EXEC + " -p 'declare var process: any\nprocess.stdin.isTTY'", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('undefined\n');

@@ -135,3 +135,3 @@ return done();

child_process_1.exec(BIN_EXEC + " -r ./tests/hello-world -p \"console.log('success')\"", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('Hello, world!\nsuccess\nundefined\n');

@@ -143,3 +143,3 @@ return done();

child_process_1.exec(BIN_EXEC + " -r typescript -e \"console.log('success')\"", function (err, stdout) {
chai_1.expect(err).to.not.exist;
chai_1.expect(err).to.equal(null);
chai_1.expect(stdout).to.equal('success\n');

@@ -146,0 +146,0 @@ return done();

{
"name": "ts-node",
"version": "3.0.2",
"version": "3.0.3",
"preferGlobal": true,

@@ -59,4 +59,4 @@ "description": "TypeScript execution environment and REPL for node",

"semver": "^5.1.0",
"tslint": "^4.0.2",
"tslint-config-standard": "^4.0.0",
"tslint": "^5.0.0",
"tslint-config-standard": "^5.0.1",
"typescript": "^2.1.4",

@@ -63,0 +63,0 @@ "typings": "^2.0.0"

@@ -7,2 +7,3 @@ # TypeScript Node

[![Test coverage][coveralls-image]][coveralls-url]
[![Greenkeeper badge](https://badges.greenkeeper.io/TypeStrong/ts-node.svg)](https://greenkeeper.io/)

@@ -78,2 +79,4 @@ > TypeScript execution environment and REPL for node. **Works with `typescript@>=1.5`**.

**NOTE**: 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`.
## Configuration Options

@@ -80,0 +83,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet