-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
HostedGitInfo.fromManifest
This encapsulates the logic used in `npm repo`
- Loading branch information
Showing
4 changed files
with
209 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ const info = hostedGitInfo.fromUrl("[email protected]:npm/hosted-git-info.git", opt | |
*/ | ||
``` | ||
|
||
If the URL can't be matched with a git host, `null` will be returned. We | ||
If the URL can't be matched with a git host, `null` will be returned. We | ||
can match git, ssh and https urls. Additionally, we can match ssh connect | ||
strings (`[email protected]:npm/hosted-git-info`) and shortcuts (eg, | ||
`github:npm/hosted-git-info`). GitHub specifically, is detected in the case | ||
|
@@ -59,6 +59,11 @@ Implications: | |
* *noCommittish* — If true then committishes won't be included in generated URLs. | ||
* *noGitPlus* — If true then `git+` won't be prefixed on URLs. | ||
|
||
### const infoOrURL = hostedGitInfo.fromManifest(manifest[, options]) | ||
|
||
* *manifest* is a package manifest, such as that returned by [`pacote.manifest()`](https://npmjs.com/pacote) | ||
* *options* is an optional object. It can have the same properties as `fromUrl` above. | ||
|
||
## Methods | ||
|
||
All of the methods take the same options as the `fromUrl` factory. Options | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters