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

code for #2 #3

Closed
wants to merge 1 commit into from
Closed

code for #2 #3

wants to merge 1 commit into from

Conversation

hemanth
Copy link
Member

@hemanth hemanth commented Jul 15, 2016

@zeke Code works fine.

For test if you want to stick we tape we would blue-tap or else we can use ava or something similar or may be just asserts ;)

@zeke
Copy link
Member

zeke commented Jul 15, 2016

This is cool, but it overrides the default behavior of simply instantiating a nice package. If we are to support this new functionality, I would like it to work without changing the existing API.

One way to do this would be to check the type of the argument passed to new Package(). If it's an object, treat it as a document from the registry. If it's a string, treat it as a package name to be downloaded.

@hemanth
Copy link
Member Author

hemanth commented Jul 15, 2016

If it's a string, treat it as a package name to be downloaded.

@zeke But the constructor can't have any async stuff in it, right?

I also tried: class Package extends Promise ...

@crookedneighbor
Copy link
Contributor

A nice thing about the existing api is that you can pass in private registry information too.

@crookedneighbor
Copy link
Contributor

Another thing to be aware of, including got as part of the package itself increases the file size quite a bit, and doesn't play nice with browserifying because many browserify shims have to be included to make got work in a browser context.

@zeke
Copy link
Member

zeke commented Jul 15, 2016

Good points, @crookedneighbor. Maybe a better approach would be to create a new npm package called get-a-nice-package or something. We could link to it in the README here.

@hemanth
Copy link
Member Author

hemanth commented Jul 16, 2016

@crookedneighbor I was thinking of the same, why not we use http instead?

@zeke I am up for fetch-nice-package I can use isomorphic-fetch what say?
But I still feel, we could use isomorphic-fetch here and enhance the PR? 🤔

@zeke
Copy link
Member

zeke commented Jul 16, 2016

fetch-nice-package and isomorphic-fetch sounds good to me. I like that idea better than trying to add more behavior and dependencies to this nice-package.

@zeke zeke closed this Jul 16, 2016
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

Successfully merging this pull request may close these issues.

None yet

3 participants