GithubHelp home page GithubHelp logo

laurelnaiad / tsconfig-glob Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wjohnsto/tsconfig-glob

0.0 3.0 0.0 19 KB

A lightweight npm package + cli that allows you to specify glob patterns for tsconfig files

License: MIT License

JavaScript 55.94% TypeScript 44.06%

tsconfig-glob's Introduction

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

```shell
-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;

	/**
	 * 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;
}

Realistic Node Usage

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.