Skip to content

Instantly share code, notes, and snippets.

@sujeetkv
Last active August 1, 2025 08:59
Show Gist options
  • Save sujeetkv/383506c42f7580abdbeed47809b8814f to your computer and use it in GitHub Desktop.
Save sujeetkv/383506c42f7580abdbeed47809b8814f to your computer and use it in GitHub Desktop.

Revisions

  1. sujeetkv revised this gist Jan 9, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion npm-with-private-repo.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ For Example:
    }
    ```

    Or you can add SSH key of of client git and use following:
    Or you can add SSH key of of git client and use following:
    ```json
    {
    "dependencies": {
  2. sujeetkv revised this gist Jan 8, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion npm-with-private-repo.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ For Example:
    "dependencies": {
    "demo-lib": "git+https://<username>:<access_token>@gitlab.com/username/demo-lib#1.2.4",
    "demo-util": "git+https://<username>:<access_token>@gitlab.com/username/demo-util#prod",
    "demo-dep": "git+https://<access_token>:x-oauth-basic@gitlab.com/username/demo-dep#prod"
    "demo-dep": "git+https://<access_token>:x-oauth-basic@github.com/username/demo-dep#master"
    }
    }
    ```
  3. sujeetkv revised this gist Jan 8, 2019. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion npm-with-private-repo.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,17 @@ For Example:
    {
    "dependencies": {
    "demo-lib": "git+https://<username>:<access_token>@gitlab.com/username/demo-lib#1.2.4",
    "demo-util": "git+https://<username>:<access_token>@gitlab.com/username/demo-util#prod"
    "demo-util": "git+https://<username>:<access_token>@gitlab.com/username/demo-util#prod",
    "demo-dep": "git+https://<access_token>:[email protected]/username/demo-dep#prod"
    }
    }
    ```

    Or you can add SSH key of of client git and use following:
    ```json
    {
    "dependencies": {
    "package-name": "git+ssh://[email protected]:username/repository.git#{branch|tag}"
    }
    }
    ```
  4. sujeetkv renamed this gist Jan 8, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. sujeetkv created this gist Jan 8, 2019.
    20 changes: 20 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ## Use private repo as npm dependency

    Create Deploy-Token (Access-Token) for particular private repo and use it in dependency as following:
    ```json
    {
    "dependencies": {
    "package-name": "git+https://<username>:<access_token>@github.com/username/repository#{branch|tag}"
    }
    }
    ```

    For Example:
    ```json
    {
    "dependencies": {
    "demo-lib": "git+https://<username>:<access_token>@gitlab.com/username/demo-lib#1.2.4",
    "demo-util": "git+https://<username>:<access_token>@gitlab.com/username/demo-util#prod"
    }
    }
    ```