{"size": 1078, "ext": "js", "max_stars_repo_path": "debug-ts.js", "max_stars_repo_name": "aminpaks/typescript-bundler", "max_stars_repo_stars_event_min_datetime": "2017-08-26T18:08:44.000Z", "max_stars_repo_stars_event_max_datetime": "2020-06-06T17:16:16.000Z", "max_issues_repo_path": "debug-ts.js", "max_issues_repo_name": "aminpaks/typescript-bundler", "max_issues_repo_issues_event_min_datetime": "2017-10-23T22:23:59.000Z", "max_issues_repo_issues_event_max_datetime": "2018-04-09T04:05:05.000Z", "max_forks_repo_path": "debug-ts.js", "max_forks_repo_name": "aminpaks/typescript-bundler", "max_forks_repo_forks_event_min_datetime": "2018-04-05T09:57:26.000Z", "max_forks_repo_forks_event_max_datetime": "2018-04-05T09:57:26.000Z"}
{"max_stars_count": 10, "max_issues_count": 10, "max_forks_count": 1, "avg_line_length": 24.5, "max_line_length": 76, "alphanum_fraction": 0.6001855288}
/**
 * @license Typescript-Debug-Script
 * (c) 2017 Amin Paks <amin.pakseresht@hotmail.com>
 * License: MIT
 */
const path = require('path');
const minimist = require('minimist');

const argv = minimist(process.argv.splice(2));
const entry = argv.entry;

if (typeof entry === 'string') {
  const entryFile = path.resolve(process.cwd(), entry.replace(/['"]/g, ''));
  const entryModule = entryFile.replace(/\.ts$/i, '');
  const extName = path.extname(entryFile);

  if (extName === '.ts') {
    const configFile = argv.tsconfig;

    require('ts-node').register({
      compilerOptions: {
        target: 'es2016',
        module: 'commonjs',
        sourceMap: true,
        noUnusedLocals: false,
        noUnusedParameters: false,
        noImplicitAny: false,
        noImplicitReturns: false,
        noImplicitThis: false,
        declaration: false,
        strict: false,
        strictNullChecks: false,
        lib: [
          'es2017',
        ]
      },
    });

    require(entryModule);
  }
} else {
  console.log('--entry argument is not a typescript file!');
}
