New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

git-subpath

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-subpath

Publish subpath of a repository to a prescribed version. Useful for installing node modules from a monorepo on github.

latest
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

Intro

This package helps in the installation of monorepo modules in subpaths from a git repository with npm, which is currently not supported.

This is done by wrapping the contents of a targetted subpath, and pushing with a tag to the same git repository, where it is now the root path and where the npm installation path can be referenced from. For a private repository, these tags remain private for access only within your organisation.

Installation and Usage

To install:

npm install --save-dev git-subpath

To use, ensure that you have a subpath in your monorepo repository that you want to tag for use in your other projects. Prepare the module name and the tag as well. The full command to create the tag should be like the following:

git-subpath -p packages/Helper -m Helper -t v0.0.1
  • p flag represents the path for the targetted installation
  • m flag represents the module name that will be used as part of the tag namespace
  • t flag represents the version number or id variant that will be used as part of the tag namespace

Upon invoking the above command successfully, the log should reveal the installation instructions at the end

=========================

Example install paths (switch out protocol as long as the remote + tag works for you) -
 HTTPS install: "npm install --save git+https://git@github.com:user/repo.git#v0.0.1-Helper"
 SSH   install: "npm install --save git+ssh://git@github.com:user/repo.git#v0.0.1-Helper"

Help

Invoke the following after the module has been installed

git-subpath --help

Instructions such as the following should appear

Usage: git-subpath [options]

Options:
  -V, --version         output the version number
  -p, --path <value>    Target path to submit
  -m, --module <value>  Module name
  -t, --tag <value>     Tag version of module
  -h, --help            output usage information

FAQs

Package last updated on 28 Apr 2019

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