Skip to content

Commit 638f5d4

Browse files
authored
Update README.md
1 parent 0daf0bf commit 638f5d4

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you are looking for a browser or node.js client, please check out the downstr
2929

3030
To install, pick one of the following based on your platform
3131

32-
```
32+
```bash
3333
# For browser client
3434
npm install @ideal-postcodes/core-browser
3535

@@ -42,17 +42,19 @@ npm install @ideal-postcodes/core-interface
4242

4343
Instantiate a client
4444

45-
```
45+
```javascript
4646
const client = new Client({});
4747
```
4848

4949
More configuration options [outlined in the docs](https://core-interface.ideal-postcodes.dev/docs/interfaces/config.html)
5050

5151
#### Resource Methods
5252

53-
A resource mapped out in [the API documentation](https://ideal-postcodes.co.uk/documentation) is exposed on the client as a method which maps closely to the low level HTTP request.
53+
Resources defined in [the API documentation](https://ideal-postcodes.co.uk/documentation) are exposed on the client. Each resource exposes a method (`#retrieve`, `#list`, etc) which maps to a resource action.
54+
55+
These methods expose a low level interface to execute HTTP requests and observe HTTP responses. They are ideal if you have a more complex query or usecase where low level access would be useful.
5456

55-
These methods are ideal if you have a more complex query (where you want low level access to the HTTP request) or you need access to the entire HTTP response.
57+
Resource methods return a promise with a HTTP response object type.
5658

5759
Requesting a resource by ID (e.g. a postcode lookup for postcode with ID "SW1A 2AA") maps to the `#retrieve` method.
5860

@@ -112,7 +114,7 @@ client.postcodes.retrieve("SW1A2AA", {
112114
}).catch(error => logger(error));
113115
```
114116

115-
[See Postcode resource API documentation](https://ideal-postcodes.co.uk/documentation/postcodes).
117+
[See Postcode resource API documentation](https://ideal-postcodes.co.uk/documentation/postcodes)
116118

117119

118120
#### Addresses
@@ -132,7 +134,7 @@ client.addresses.list({
132134
}).catch(error => logger(error));
133135
```
134136

135-
[See addresses resource API documentation](https://ideal-postcodes.co.uk/documentation/addresses).
137+
[See addresses resource API documentation](https://ideal-postcodes.co.uk/documentation/addresses)
136138

137139
#### Autocomplete
138140

@@ -151,7 +153,7 @@ client.autocomplete.list({
151153
}).catch(error => logger(error));
152154
```
153155

154-
[See autocomplete resource API documentation](https://ideal-postcodes.co.uk/documentation/autocomplete).
156+
[See autocomplete resource API documentation](https://ideal-postcodes.co.uk/documentation/autocomplete)
155157

156158
#### UDPRN
157159

@@ -167,7 +169,7 @@ client.udprn.retrieve("12345678", {
167169
}).catch(error => logger(error));
168170
```
169171

170-
[See UDPRN resource API documentation](https://ideal-postcodes.co.uk/documentation/udprn).
172+
[See UDPRN resource API documentation](https://ideal-postcodes.co.uk/documentation/udprn)
171173

172174
#### UMPRN
173175

@@ -183,7 +185,7 @@ client.umprn.retrieve("87654321", {
183185
}).catch(error => logger(error));
184186
```
185187

186-
[See UMPRN resource API documentation](https://ideal-postcodes.co.uk/documentation/umprn).
188+
[See UMPRN resource API documentation](https://ideal-postcodes.co.uk/documentation/umprn)
187189

188190
#### Keys
189191

@@ -220,13 +222,13 @@ client.keys.usage("iddqd", {
220222
}).catch(error => logger(error));
221223
```
222224

223-
[See Keys resource API documentation](https://ideal-postcodes.co.uk/documentation/keys).
225+
[See Keys resource API documentation](https://ideal-postcodes.co.uk/documentation/keys)
224226

225227
### Errors
226228

227-
Core Interface also exports:
229+
For more advanced use cases, this library also exports:
228230

229-
- Class implementations for Ideal Postcodes API errors that inherit from javascript `Errors`
231+
- Class implementations for Ideal Postcodes API errors that inherit from `Error`
230232
- A parser that converts raw error data into an error instance
231233

232234
#### Usage
@@ -255,9 +257,9 @@ switch (true) {
255257

256258
#### Error Prototype Chain
257259

258-
All errors inherit from Javascript's `Error` prototype
260+
All errors inherit from Javascript's `Error` prototype.
259261

260-
Errors are grouped by HTTP status code classes
262+
Errors are grouped by HTTP status code classes.
261263

262264
Specific errors may be supplied for the following reasons:
263265
- Convenience: They are frequently tested for (e.g. invalid postcode, postcode not found)

0 commit comments

Comments
 (0)