Skip to content

Package manager

Francesco Saverio Castellano edited this page Apr 1, 2020 · 23 revisions

The TINN executable is also a package manager and builder for native modules.
The package manager is inspired by npm and provides install/uninstall commands what work in the same fashion as the ones in npm. Dependencies are automatically resolved and installed/uninstalled.
Packages can be installed locally (in the local tinn_modules directory in the current project) or globally (in the TINN root directory or in TINN_PATH if this environment variable is set).
 
The TINN package manager does not have its own registry. It uses github APIs to search and download packages. This means that only github projects can be installed via the TINN package manager.
 
List of supported commands:

search

Searches for a package in git.

$ tinn search search_string

All packages matching search_string will be returned.
For instance the following command:

$ tinn search tinn_web

Returns this output:

 tinn_web 249009685 - Simple web framework for TINN
 WebtechExamen_TinneJacobs 56081942 - Webtech
 TinnesWebsite 150573377
 angular-web-application-TinnyNoyens 192178214 - angular-web-application-TinnyNoyens
 tinnker-web 33100986 - Website for the tinnker
 Tinn-R-Website 151596616 - Tinn-R Editor Website
 tinng-client-web 25534302 - Standard web client for the "tinng" communication service

SUCCESS 7 projects found.

For each project search returns the following information: project name, id and description

info

Returns information about a package.

$ tinn info package_name

Here package_name must be the name of the package or a search string (in this case the information returned corresponds to the first package matching the search string). When using this command in order to be sure that the right project is identified it is possible to add the project id after a space following the project name:

 $ tinn info tinn_web 249009685

The following details are returned: project name, id, description, url, creation date, date of last update, tags.

install

Installs the requested package and all its dependencies.

$ tinn install package_name

By default the package is installed locally in tinn_modules directory. If package.json exists in the current project then the package being installed is saved as a dependency of the current project in its package.json file.
if the --global or -g flag is provided then the package is installed globally. The global installation path is the directory pointed to by the NODE_PATH environment variable when set or the tinn_modules directory in the TINN root directory.
As for the info command, in order to be sure that the right project is install, it is possible to add a space after project_name followed by the id of the project:

 $ tinn install tinn_web 249009685

In order to install a specific tag of a project specify the tag name by appending it to the project name using @ as a separator:

$ tinn install [email protected] 249009685

uninstall

Uninstalls a package and it dependencies. If the --global or -g flag is provided the package is uninstalled globally (in this case its dependencies are not uninstalled).
When a package is uninstalled locally its dependencies are also uninstall and the current project's package.json file is updated is there is any.
Uninstalling a package that is a dependency of one or more packages currently installed produces an error.
A package can be forced to uninstall by using the --force or -f flag.

Clone this wiki locally