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

how to use GitHub.search() ? #367

Closed
ssr66994053 opened this issue Jul 21, 2016 · 1 comment
Closed

how to use GitHub.search() ? #367

ssr66994053 opened this issue Jul 21, 2016 · 1 comment

Comments

@ssr66994053
Copy link

ssr66994053 commented Jul 21, 2016

from the api docs
search() needs a string, but it needs an object?! is the docs wrong? or i am wrong?

my code :

import GitHub from 'github-api'

var gh = new GitHub();

gh.search().forRepositories({q:'react'})
.then(({data: repos}) => {
  console.log(repos)
}).catch((error) => {
  console.log('forRepositories error:', error)
})
// or 
gh.search({q:'react'}).forRepositories()
.then(({data: repos}) => {
  console.log(repos)
}).catch((error) => {
  console.log('forRepositories error:', error)
})

env:

node -v
v5.1.1

npm -v
3.3.12

but nothing print out....
and there is no example for search? can i have an example for function search ?

thanks :)

@ssr66994053
Copy link
Author

ssr66994053 commented Jul 22, 2016

sorry, i was wrong.
it worked, but very slow because of the network and search method will get all pages.

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

1 participant