1.6.0 • Published 5 years ago

tfs v1.6.0

Weekly downloads
834
License
MIT
Repository
github
Last release
5 years ago

tfs

The MIT License npm Build Status dependencies Status devDependencies Status

NodeJS wrapper for Team Foundation Source Control CLI.


Getting Started

If you're a NodeJS developer whishing to use it as a dependency, there is a module exposing all commands and described in the NodeJS API.

Installation

npm install -g tfs

Usage

Usage: tfs <cmd>

Commands

add [itemspec] [options]       Adds files and folders to version control.
checkin [itemspec] [options]   Commits pending changes in the current workspace.
checkout [itemspec] [options]  Makes the local file writable, and changes its status to "edit".
get [itemspec] [options]       Get the latest version of files and folders.
history [itemspec] [options]   Displays the revision history for one or more files, folders or both.
info [itemspec] [options]      Displays information about items under version control.
status [itemspec] [options]    Displays information about pending changes.
undo <itemspec> [options]      Removes pending changes from a workspace.
help [cmd]                     Displays help for [cmd].

Get more information about each command

Since tfs is a wrapper, it only check and execute commands via TF.exe command line tool. So to know how to use each command, just check the Tf Command-Line Utility Commands official documentation.

Also don't hesitate to use the help command, i.e. :

tfs [cmd] -h, --help

Or :

tfs help [cmd]

Options:

  -h, --help  output usage information

Good to know

For [itemspec] commands :

  • If you omit [itemspec], it will apply on the current directory.
  • You can use a relative, an absolute or a TFS path.
  • You can give multiple files/directories separated by a space.

NodeJS API

You can install tfs as a dependency for your NodeJS projects :

npm install tfs --save

Usage example

Some commands, like status, have extra-properties in their response. To get real-life examples of common commands, check this Github directory.

To recursively get the status (pending changes) of files within D:\MyBranch\MyProject, admitting that this project is source-versionned via TFS, you could write the following code :

var tfs = require('tfs');

var callback = function(responseError, response) {
  if (responseError) {
    console.error(responseError.error);
    return;
  }

  console.log(response.message);
  console.log(response.status);
}

tfs('status', 'D:/MyProject/MyBranch', {
  recursive: true
}, callback);

tfs description

tfs(command, [items, [options, [callback]]]);

command

{String} TFS command to execute.

items

{Array} File(s) or changeset number.
        Can be null/undefined to use the current path.

options

{Object} TFS command options. Can be null/undefined.

callback

{Function} Function to call back once command executed.
           Will be called back with 2 arguments: error, response.

           error: {
             error:   {String},
             isError: true
           }

           response: {
             message: {String},
             isError: false
           }

Licenses

FOSSA Status

1.6.0

5 years ago

1.5.0

6 years ago

1.4.2

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.9

9 years ago

1.2.8

9 years ago

1.2.7

9 years ago

1.2.6

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.0

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.6

11 years ago

0.2.5

11 years ago

0.2.4

11 years ago

0.2.3

11 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.4

12 years ago