Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a direct npm-package to repository-url endpoint #75

Open
caub opened this issue May 11, 2018 · 2 comments
Open

Adding a direct npm-package to repository-url endpoint #75

caub opened this issue May 11, 2018 · 2 comments

Comments

@caub
Copy link

caub commented May 11, 2018

It's very useful as a browser search engine

Currently I've added https://caub.github.io/misc/npm-to-gh?q=%s in my browser search engines, as 'npm', then I can quickly type npm TAB some-package ENTER

source: https://github.com/caub/misc/blob/master/npm-to-gh.html#L32-L42

if you could handle it directly it would be ideal, and remove the need of that hacky script

@satazor
Copy link
Member

satazor commented Nov 6, 2018

@caub I'm not sure what you meant with this issue. Both the search and package info endpoints contain the repository url, e.g.: https://api.npms.io/v2/search?from=0&q=foo&size=1 and https://api.npms.io/v2/package/foo.

Can you elaborate?

@caub
Copy link
Author

caub commented Nov 6, 2018

@satazor yes that's what I'm using https://github.com/caub/misc/blob/master/npm-to-gh.html#L51

What I mean is having an endpoint like https://api.npms.io/v2/package/foo/url?redirect that'd reply with a Location: https://github.com/jasonLaster/foo header and 307 status, so that adding https://api.npms.io/v2/package/%s/url?redirect in chrome search engines as npm, I can type npm foo and go to the sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants