Socket
Socket
Sign inDemoInstall

tsd

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsd

The TypeScript definition package manager.


Version published
Weekly downloads
144K
decreased by-7.06%
Maintainers
1
Weekly downloads
 
Created
Source

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

How to install

TSD is installed using node and npm. 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:

{
	"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 project. You can view the repository references inside 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

Steps

  1. Open Visual Studio and Create a TypeScript application

I will create an application named TestApp

  1. Open NuGet Console

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

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

  1. Now you can see that TSD has created a file named tsd-config.json on your app root folder. To include this file on your application go to Vidual Studio Solution Explorer and select Show All Files.

This will show tsd-config.json file on Solution Explorer.

  1. Take right click on tsd-config.json file and select Include In Project. Now you can edit this file on visual Studio. See configuration section.

  2. Try install jquery definition file using tsd install jquery on NuGet Console and go to Vidual Studio Solution Explorer and select Show All Files(if it is not enabled) to view ts-definition folder with jquery definition file. Include this folder in project.

You can test other TSD commands like tsd all See usage section.

Change log

v0.3.1 (2013-01-26)

v0.3.0 (2013-01-25)

  • Multiple installs at once install command #3. Thanks to @Crwth
  • Command for show/info #2. Thanks to @semperos
  • Allow user to change repository url from local config file
  • Command to create local config file
  • Solved issue: DefinitelyTyped directory structure is lost #4. Thanks to @Crwth

v0.2.2 (2012-11-07)

  • Fix: now tsd works on linux/mac. Issue #1. Thanks to @seanhess

License

TSD is distributed under the MIT license. See license file here or below:

Copyright (c) 2012 by Diullei Gomes

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 26 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc