<commit_before>TSD - A TypeScript definition package manager
=============================================

TSD is a TypeScript definition file package manager.  let you easily download and install definition files to use in TypeScript projects.

> To view online package search go to http://www.tsdpm.com/

> To view how to use TSD with NuGet Console go to [Using TSD with Visual Studio Nuget Console](https://github.com/Diullei/tsd#using-tsd-with-visual-studio-nuget-console)

### How to install

TSD is installed using [node](http://nodejs.org/) and [npm](https://npmjs.org/). To install TSD use:

    npm install tsd -g

### Usage

> Your best friend at this stage is probably `tsd -h`.

To view all repository files use:

    tsd all

This will print all file definitions available on repository. To install some file on local project you must use `install` command followed by a lib name:

    tsd install node

This will create by default a folder named `d.ts` (if it doesn't exists) and will download the file definition to this folder.

### TSD configuration

You can define your own custom folder to store definition files with the command:

	tsd ncfg

This will create a file named `tsd-config.json` on current folder with the following content:

```json	
{
	"localPath": "ts-definitions",
	"repositoryType": "1",
	"uri": "https://github.com/Diullei/tsd/raw/master/deploy/repository.json"
}
```

* **localPath** - Must be the path to your local folder to store definition files. This folder will be created in the first time if not exists.
* **repositoryType** - this property is used to define if uri is a local folder or a url. Use `0` to local folder or `1` to url.
* **uri** - Define if the repository file is an url or a local folder.

### Installing dependencies

Some definition files have dependencies of another files like `socket.io` that depends of `node`. To install dependencies you can use `tsd install` command followed by a list of libs to install. 

Example:

	tsd install socket.io node express
	
This will install _express_, _socket.io_ and _node_ definitions.

### Install dependencies automatically

You can use `install*` command to allow TSD tool to automatically map and install all necessary dependencies. If you use `install* sochet.io` this will install `sochet.io` and `node` because `sochet.io` has `node` mapped as a dependency. If you use the command:

	tsd install* knockback
	
TSD will install `knockback`, `knockout` and `backbone` definition.

### Checking for updates

You can always use `tsd update` command to verify if your local libs are updated.

### Repository

To make a search for any file you must use `search` command.

Example:

    tsd search backbone

TSD get the file definitions from [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) project. You can view the repository references inside [repository.json](https://github.com/Diullei/tsd/blob/master/deploy/repository.json) file (I'm working to add some anothers). If you want to contribute please make a fork from tsd repo, change the repository.json and make a pull request.

> This file is updated constantly.

## Using TSD with Visual Studio NuGet Console

You can use TSD with Visual Studio NuGet Console. NuGet Console is a PowerShell Console and can normally call any application on Windows PATH. For view how to use TSD I suggest the following steps:

### Prerequisites

* [TypeScript Visual Studio Plugin](http://www.microsoft.com/en-us/download/details.aspx?id=34790)
* TSD 0.3.1 or last - [View How to install section](https://github.com/Diullei/tsd#how-to-install)

### Steps

1. Open Visual Studio and Create a TypeScript application 

![](https://github.com/Diullei/tsd/raw/master/doc_img/create_ts_app.png)

> I will create an application named `TestApp`

2. Open NuGet Console

![](https://github.com/Diullei/tsd/raw/master/doc_img/open_nuget_console.png)

3. Goto TestApp root folder. Enter the `cd .\TestApp` command on NuGet Console.

4. Create a TSD config file. On NuGet Console use the command: `tsd ncfg`.

![](https://github.com/Diullei/tsd/raw/master/doc_img/tsd_cnfg_nuget.png)
<commit_msg>update README file<commit_after>TSD - A TypeScript definition package manager
=============================================

TSD is a TypeScript definition file package manager.  let you easily download and install definition files to use in TypeScript projects.

> To view online package search - http://www.tsdpm.com/

> To view how to use TSD with NuGet Console - [Using TSD with Visual Studio Nuget Console](https://github.com/Diullei/tsd#using-tsd-with-visual-studio-nuget-console)

> To contribute by adding new references - [How to contribute](https://github.com/Diullei/tsd#how-to-contribute)

### How to install

TSD is installed using [node](http://nodejs.org/) and [npm](https://npmjs.org/). To install TSD use:

    npm install tsd -g

### Usage

> Your best friend at this stage is probably `tsd -h`.

To view all repository files use:

    tsd all

This will print all file definitions available on repository. To install some file on local project you must use `install` command followed by a lib name:

    tsd install node

This will create by default a folder named `d.ts` (if it doesn't exists) and will download the file definition to this folder.

### TSD configuration

You can define your own custom folder to store definition files with the command:

	tsd ncfg

This will create a file named `tsd-config.json` on current folder with the following content:

```json	
{
	"localPath": "ts-definitions",
	"repositoryType": "1",
	"uri": "https://github.com/Diullei/tsd/raw/master/deploy/repository.json"
}
```

* **localPath** - Must be the path to your local folder to store definition files. This folder will be created in the first time if not exists.
* **repositoryType** - this property is used to define if uri is a local folder or a url. Use `0` to local folder or `1` to url.
* **uri** - Define if the repository file is an url or a local folder.

### Installing dependencies

Some definition files have dependencies of another files like `socket.io` that depends of `node`. To install dependencies you can use `tsd install` command followed by a list of libs to install. 

Example:

	tsd install socket.io node express
	
This will install _express_, _socket.io_ and _node_ definitions.

### Install dependencies automatically

You can use `install*` command to allow TSD tool to automatically map and install all necessary dependencies. If you use `install* sochet.io` this will install `sochet.io` and `node` because `sochet.io` has `node` mapped as a dependency. If you use the command:

	tsd install* knockback
	
TSD will install `knockback`, `knockout` and `backbone` definition.

### Checking for updates

You can always use `tsd update` command to verify if your local libs are updated.

### Repository

To make a search for any file you must use `search` command.

Example:

    tsd search backbone

TSD get the file definitions from [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) project. You can view the repository references inside [repository.json](https://github.com/Diullei/tsd/blob/master/deploy/repository.json) file (I'm working to add some anothers). If you want to contribute please make a fork from tsd repo, change the repository.json and make a pull request.

> This file is updated constantly.

## How to contribute

To contribute adding new definition files references "fork" this project and add a new file on `repo_data` folder according to the following specifications:

```json	
{
  "name": "LIB NAME", // must match the file name without json extension
  "description": "LIB DESCRIPTION",
  "versions": [
    {
      "version": "x.x", // LIB VERSION
      "key": "FILE VERSION KEY", // must be a unique key like a guid. You can use [this tool](http://www.guidgenerator.com/) to generate this key
      "dependencies": [
        {
          "name": "LIB NAME",
          "version": "VERSION"
        }
      ],
      "url": "DEFINITION FILE URL",
      "author": "DEFINITION FILE AUTHOR",
      "author_url": "AUTHOR URL"
    }
  ]
}
```

Example:

```json	
{
  "name": "angular-resource",
  "description": "Google - Angular.Js",
  "versions": [
    {
      "version": "1.0",
      "key": "<KEY>",
      "dependencies": [
        {
          "name": "angular",
          "version": "latest"
        }
      ],
      "url": "https://github.com/borisyankov/DefinitelyTyped/raw/master/angularjs/angular-resource.d.ts",
      "author": "<NAME>",
      "author_url": "https://github.com/diegovilar"
    }
  ]
}
```

Done that, send a pull request.

## Using TSD with Visual Studio NuGet Console

You can use TSD with Visual Studio NuGet Console. NuGet Console is a PowerShell Console and can normally call any application on Windows PATH. For view how to use TSD I suggest the following steps:

### Prerequisites

* [TypeScript Visual Studio Plugin](http://www.microsoft.com/en-us/download/details.aspx?id=34790)
* TSD 0.3.1 or last - [View How to install section](https://github.com/Diullei/tsd#how-to-install)

### Steps

1. Open Visual Studio and Create a TypeScript application 

![](https://github.com/Diullei/tsd/raw/master/doc_img/create_ts_app.png)

> I will create an application named `TestApp`

2. Open NuGet Console

![](https://github.com/Diullei/tsd/raw/master/doc_img/open_nuget_console.png)

3. Goto TestApp root folder. Enter the `cd .\TestApp` command on NuGet Console.

4. Create a TSD config file. On NuGet Console use the command: `tsd ncfg`.

![](https://github.com/Diullei/tsd/raw/master/doc_img/tsd_cnfg_nuget.png)

{'fraction_non_alphanumeric': 0.10618460582202424, 'fraction_numerical': 0.003315031596394903, 'mean_word_length': 3.8831562974203337, 'pattern_counts': {'":': 28, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 21, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7090307', 'n_tokens_mistral': 2863, 'n_tokens_neox': 2718, 'n_words': 1190}