Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-pkg-installer

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-pkg-installer - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

48

bin/ts-pkg-installer.js

@@ -21,2 +21,4 @@ // ts-pkg-installer.ts

var path = require('path');
// There is no DTS for this package, but we will promisify it later.
var readPackageJson = require('read-package-json');
var util = require('./util');

@@ -37,3 +39,3 @@ BluePromise.longStackTraces();

// Define the CLI.
commander.option('-f, --config-file <path>', 'Config file [' + defaultOptions.configFile + ']', defaultOptions.configFile).option('-n, --dry-run', 'Dry run (display what would happen without taking action)').option('-v, --verbose', 'Verbose logging').version('1.0.0');
commander.option('-f, --config-file <path>', 'Config file [' + defaultOptions.configFile + ']', defaultOptions.configFile).option('-n, --dry-run', 'Dry run (display what would happen without taking action)').option('-v, --verbose', 'Verbose logging');
var debugNamespace = 'ts-pkg-installer';

@@ -70,2 +72,3 @@ var dlog = debug(debugNamespace);

})();
var readPackageJsonAsync = BluePromise.promisify(readPackageJson);
// ## fsExistsAsync

@@ -507,19 +510,32 @@ // Special handling for fs.exists, which does not conform to Node.js standards for async interfaces.

})();
// Parse command line arguments.
commander.parse(process.argv);
dlog('commander:\n' + JSON.stringify(commander, null, 2));
if (commander.args.length !== 0) {
process.stderr.write('Unexpected arguments.\n');
commander.help();
}
else {
// Retrieve the options (which are stored as undeclared members of the command object).
var options = new Options(commander);
var mgr = new TypeScriptPackageInstaller(options);
mgr.main().catch(function (err) {
dlog(err.toString());
process.stderr.write(__filename + ': ' + err.toString() + '\n');
process.exit(1);
// Set the version of this tool based on package.json.
function setVersion() {
var packageJsonFile = path.join(__dirname, '..', 'package.json');
return readPackageJsonAsync(packageJsonFile).then(function (packageJson) {
var version = packageJson.version;
dlog('Version:', version);
commander.version(version);
return;
});
}
// Determine the version before parsing command-line.
setVersion().then(function () {
// Parse command line arguments.
commander.parse(process.argv);
dlog('commander:\n' + JSON.stringify(commander, null, 2));
if (commander.args.length !== 0) {
process.stderr.write('Unexpected arguments.\n');
commander.help();
}
else {
// Retrieve the options (which are stored as undeclared members of the command object).
var options = new Options(commander);
var mgr = new TypeScriptPackageInstaller(options);
mgr.main().catch(function (err) {
dlog(err.toString());
process.stderr.write(__filename + ': ' + err.toString() + '\n');
process.exit(1);
});
}
});
//# sourceMappingURL=ts-pkg-installer.js.map

@@ -28,2 +28,5 @@ // ts-pkg-installer.ts

// There is no DTS for this package, but we will promisify it later.
var readPackageJson = require('read-package-json');
import util = require('./util');

@@ -53,4 +56,3 @@

.option('-n, --dry-run', 'Dry run (display what would happen without taking action)')
.option('-v, --verbose', 'Verbose logging')
.version('1.0.0');
.option('-v, --verbose', 'Verbose logging');

@@ -126,2 +128,8 @@ var debugNamespace = 'ts-pkg-installer';

// ## readPackageJsonAsync
interface IReadPackageJsonAsync {
(packageFile: string): BluePromise<string>;
}
var readPackageJsonAsync: IReadPackageJsonAsync = <IReadPackageJsonAsync> BluePromise.promisify(readPackageJson);
// ## fsExistsAsync

@@ -664,19 +672,36 @@ // Special handling for fs.exists, which does not conform to Node.js standards for async interfaces.

// Parse command line arguments.
commander.parse(process.argv);
dlog('commander:\n' + JSON.stringify(commander, null, 2));
if (commander.args.length !== 0) {
process.stderr.write('Unexpected arguments.\n');
commander.help();
} else {
// Retrieve the options (which are stored as undeclared members of the command object).
var options = new Options(commander);
var mgr = new TypeScriptPackageInstaller(options);
mgr.main()
.catch((err: Error) => {
dlog(err.toString());
process.stderr.write(__filename + ': ' + err.toString() + '\n');
process.exit(1);
// Set the version of this tool based on package.json.
function setVersion(): BluePromise<void> {
var packageJsonFile: string = path.join(__dirname, '..', 'package.json');
return readPackageJsonAsync(packageJsonFile)
.then((packageJson: any): void => {
var version: string = packageJson.version;
dlog('Version:', version);
commander.version(version);
return;
});
}
// Determine the version before parsing command-line.
setVersion()
.then((): void => {
// Parse command line arguments.
commander.parse(process.argv);
dlog('commander:\n' + JSON.stringify(commander, null, 2));
if (commander.args.length !== 0) {
process.stderr.write('Unexpected arguments.\n');
commander.help();
} else {
// Retrieve the options (which are stored as undeclared members of the command object).
var options = new Options(commander);
var mgr = new TypeScriptPackageInstaller(options);
mgr.main()
.catch((err: Error) => {
dlog(err.toString());
process.stderr.write(__filename + ': ' + err.toString() + '\n');
process.exit(1);
});
}
});
{
"name": "ts-pkg-installer",
"version": "1.0.8",
"version": "1.0.9",
"description": "TypeScript package installer",

@@ -40,4 +40,5 @@ "main": "bin/ts-pkg-installer.js",

"mkdirp": "^0.5.0",
"read-package-json": "^1.3.2",
"source-map-support": "^0.2.9"
}
}

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