think-typescript

2.0.0 • Public • Published

think-typescript

think-typescript

Build Status Coverage Status npm

think-typescript compile typescript file

Syntax

import thinkTypescript from 'think-typescript';
thinkTypescript({
  srcPath,
  outPath,
  file,
  typescriptOptions,
  ext,
});
 
  • srcPath {String} the file source path.
  • outPath {String} the directory for output file.
  • file {String} the file path in the 'srcPath'.
  • [typescriptOptions] {Object} the typescript options,default {fileName: file, reportDiagnostics: true, compilerOptions: {module: 'commonjs', target: 'es5', sourceMap: true}}.
  • [ext] {String} the new file extension,default .js.

Usage

Compile typescript file:

import thinkTypescript from 'think-typescript';
 
thinkTypescript({
  srcPath: './test/src/a',
  outPath: './test/out',
  file: 'b/test.ts'
});
 

/think-typescript/

    Package Sidebar

    Install

    npm i think-typescript

    Weekly Downloads

    11

    Version

    2.0.0

    License

    ISC

    Unpacked Size

    5.53 kB

    Total Files

    6

    Last publish

    Collaborators

    • lushijie
    • sijiecai
    • welefen