Skip to content

Commit 1cbeabb

Browse files
authored
updated read me
1 parent 894810f commit 1cbeabb

File tree

1 file changed

+56
-4
lines changed

1 file changed

+56
-4
lines changed

README.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,27 @@ The intent is to simplify the request process by handling the tedious logic. It'
77
[![npm version](https://badge.fury.io/js/ebay-node-api.svg)](https://badge.fury.io/js/ebay-node-api)
88
[![Build Status](https://travis-ci.org/ajay2507/ebay-node-api.svg?branch=master)](https://travis-ci.org/ajay2507/ebay-node-api)
99

10-
# Installing
10+
11+
## Table of Contents
12+
13+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
14+
15+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
16+
17+
* [Installation](#installation)
18+
* [Usage](#usage)
19+
* [Examples](#examples)
20+
* [Getting Access Token](#getaccesstoken)
21+
* [Fetch Items By Keyword](#fetchitemsbykeyword)
22+
* [Get All Categories](#getallcategories)
23+
* [Get Items By Category](#getitemsbycategory)
24+
* [Test](#test)
25+
* [Issues](#issues)
26+
* [LICENSE](#license)
27+
28+
29+
30+
## Installation
1131

1232
```shell
1333
npm install ebay-node-api
@@ -25,7 +45,7 @@ let ebay = new eBay({
2545
```
2646
Creates a new `Ebay` instance.
2747

28-
### How to get clientId:
48+
### Getting Client ID:
2949

3050
Join eBay developers program.
3151
Register your app here https://go.developer.ebay.com/quick-start-guide.
@@ -36,7 +56,7 @@ Register your app here https://go.developer.ebay.com/quick-start-guide.
3656
- `limit` - optional(`Number`) - fetch items functionality - Number that limits the number of data you need in response.
3757
- `details` - optional(`Boolean`) - Get User Details functionality - true, if you need details about the user.
3858

39-
#### Example
59+
## Example
4060

4161
## GetAccessToken
4262

@@ -72,7 +92,37 @@ ebay.findItemsByKeywords("iphone").then((data) => {
7292
});
7393
```
7494

75-
## How do I run the tests?
95+
## GetAllCategories
96+
```javascript
97+
const Ebay = require('../src/index');
98+
99+
let ebay = new Ebay({
100+
clientID: "-- Client App id ----",
101+
details: "childCategories" //optional parameter
102+
});
103+
104+
ebay.getAllCategories().then((data) => {
105+
console.log(data); //extract data.CategoryArray
106+
}, (error) => {
107+
console.log(error);
108+
})
109+
```
110+
## GetItemsByCategory
111+
```javascript
112+
const Ebay = require('../src/index');
113+
114+
let ebay = new Ebay({
115+
clientID: "-- Client APP ID ----",
116+
limit: 6
117+
});
118+
ebay.findItemsByCategory(10181).then((data) => {
119+
console.log(data);
120+
}, (error) => {
121+
console.log(error);
122+
});
123+
```
124+
125+
## Test
76126
All test files are present inside test folder. You can run using
77127

78128
```javascript
@@ -81,6 +131,8 @@ npm run test
81131
## Issues:
82132
If you are facing any issues, you can create the issues [here](https://github.com/ajay2507/ebay-node-api/issues).
83133

134+
## License:
135+
MIT.
84136

85137
## Examples:
86138
I have mentioned the examples here

0 commit comments

Comments
 (0)