Thanks to visit codestin.com
Credit goes to github.com

Skip to content

how to use GitHub.search() ? #367

Closed
Closed
@ssr66994053

Description

@ssr66994053

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions