0.4.3 • Published 8 years ago

tsconfig-glob v0.4.3

Weekly downloads
1,552
License
MIT
Repository
github
Last release
8 years ago

npm version Downloads Dependency Status devDependency Status

tsconfig-glob

A lightweight npm package + cli that allows you to specify glob patterns for tsconfig files. Most of the credit is due to glob/minimatch, this is a very thin layer on top of those libraries.

Install

Use npm to install this package.

Locally:

npm install tsconfig-glob --save-dev

or, Globally:

npm install -g tsconfig-glob --save-dev

Usage

You can use this library as either a CLI or in a node script. It follows a similar format to the atom-typescript plugin:

  1. You provide a path to a directory containing a tsconfig.json
  2. You specify a filesGlob pattern in your tsconfig.json
  3. The library will find the files matching the filesGlob patterns and put them in the files property

Using the CLI

tsconfig .

Options

```bash
-i, --indent <number> The number of spaces to indent the tsconfig.json file (defaults to 4)
--empty Output an empty files array (ignoring the specified globs)
```

Using with Node

import * as tsconfig from 'tsconfig-glob';
tsconfig(null, function(err) => {
    ...
});

Options

{
	/**
	 * A relative path from cwd to the directory containing a tsconfig.json. If not specified, the '.' is used.
	 */
	configPath?: string;
    
    /**
     * Typescript confiuration file name in `configPath` directory
     */
    configFileName?: string;

	/**
	 * The current working directory, defaults to `process.cwd()`
	 */
	cwd?: string;

	/**
	 * The number of spaces to indent the tsconfig.json
	 */
	indent?: number;

	/**
	 * Output an empty files array (ignoring the specified globs)
	 */
	empty?: boolean;

	/**
	 * Asynchronous callback (default: true)
	 */
	async?: boolean;
}

Realistic Node Usage

import * as tsconfig from 'tsconfig-glob';
tsconfig({
	configPath: '.',
	cwd: process.cwd(),
	indent: 2
}, function(err) {
    ...
});
0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago