Skip to content

Commit fff47b1

Browse files
committed
feat: Rename package to govuk-api
1 parent 4cc5059 commit fff47b1

5 files changed

Lines changed: 19 additions & 19 deletions

File tree

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
JavaScript API client for GOV.UK Content and Search APIs.
44

5-
[![GOVUK API latest npm version](https://img.shields.io/npm/v/@nickcolley/govuk.svg?v=2)](https://www.npmjs.com/package/@nickcolley/govuk)
5+
[![GOVUK API latest npm version](https://img.shields.io/npm/v/govuk-api.svg?v=2)](https://www.npmjs.com/package/govuk-api)
66

77
## Contents
88

@@ -17,12 +17,12 @@ JavaScript API client for GOV.UK Content and Search APIs.
1717

1818
```bash
1919
npm init mjs -y # initialise module-ready package.json
20-
npm install @nickcolley/govuk
20+
npm install govuk-api
2121
```
2222

2323
```javascript
2424
// index.js;
25-
import { SearchAPI, ContentAPI } from "@nickcolley/govuk";
25+
import { SearchAPI, ContentAPI } from "govuk-api";
2626

2727
const searchApi = new SearchAPI();
2828
const contentApi = new ContentAPI();
@@ -44,7 +44,7 @@ node index.js
4444
```html
4545
<!-- index.html -->
4646
<script type="module">
47-
import { SearchAPI, ContentAPI } from "https://unpkg.com/@nickcolley/govuk";
47+
import { SearchAPI, ContentAPI } from "https://unpkg.com/govuk-api";
4848
4949
const searchApi = new SearchAPI();
5050
const contentApi = new ContentAPI();
@@ -80,7 +80,7 @@ Returns a [content item](https://content-api.publishing.service.gov.uk/reference
8080
#### Getting data from resolved promise
8181

8282
```javascript
83-
import { ContentAPI } from "@nickcolley/govuk";
83+
import { ContentAPI } from "govuk-api";
8484
const api = new ContentAPI();
8585
const contentItem = await api.get("Register-to-vote");
8686
console.log(contentItem);
@@ -89,7 +89,7 @@ console.log(contentItem);
8989
#### Getting data from event
9090

9191
```javascript
92-
import { ContentAPI } from "@nickcolley/govuk";
92+
import { ContentAPI } from "govuk-api";
9393
const api = new ContentAPI();
9494
api.on("data", (contentItem) => {
9595
console.log(contentItem);
@@ -115,7 +115,7 @@ Set the default query and options for all other calls to `get`, `getAll` and `to
115115
#### Getting data from resolved promise
116116

117117
```javascript
118-
import { SearchAPI } from "@nickcolley/govuk";
118+
import { SearchAPI } from "govuk-api";
119119
const api = new SearchAPI("Micro pig", { count: 10 });
120120
const searchResults = await api.get();
121121
console.log(searchResults);
@@ -133,7 +133,7 @@ Get first page of search items for a query
133133
#### Getting data from resolved promise
134134

135135
```javascript
136-
import { SearchAPI } from "@nickcolley/govuk";
136+
import { SearchAPI } from "govuk-api";
137137
const api = new SearchAPI();
138138
const searchResults = await api.get("Micro pig");
139139
console.log(searchResults);
@@ -142,7 +142,7 @@ console.log(searchResults);
142142
#### Getting data from event
143143

144144
```javascript
145-
import { SearchAPI } from "@nickcolley/govuk";
145+
import { SearchAPI } from "govuk-api";
146146
const api = new SearchAPI();
147147
api.on("data", (searchResults) => {
148148
console.log(searchResults);
@@ -163,7 +163,7 @@ Get all pages of search items for a query.
163163
#### Getting data from resolved promise
164164

165165
```javascript
166-
import { SearchAPI } from "@nickcolley/govuk";
166+
import { SearchAPI } from "govuk-api";
167167
const api = new SearchAPI();
168168
const searchResults = await api.getAll("Micro pig");
169169
console.log(searchResults);
@@ -172,7 +172,7 @@ console.log(searchResults);
172172
#### Getting data from event
173173

174174
```javascript
175-
import { SearchAPI } from "@nickcolley/govuk";
175+
import { SearchAPI } from "govuk-api";
176176
const api = new SearchAPI();
177177
api.on("data", (searchResults) => {
178178
console.log(searchResults);
@@ -191,7 +191,7 @@ Get metadata for a content item.
191191
#### Getting info from resolved promise
192192

193193
```javascript
194-
import { SearchAPI } from "@nickcolley/govuk";
194+
import { SearchAPI } from "govuk-api";
195195
const api = new SearchAPI();
196196
const contentInfo = await api.info("register-to-vote");
197197
console.log(contentInfo);
@@ -209,7 +209,7 @@ Get total amount of search items for a query.
209209
#### Getting total from resolved promise
210210

211211
```javascript
212-
import { SearchAPI } from "@nickcolley/govuk";
212+
import { SearchAPI } from "govuk-api";
213213
const api = new SearchAPI();
214214
const totalResults = await api.total("Micro pig");
215215
console.log(totalResults);
@@ -226,7 +226,7 @@ Get facets for a field.
226226
#### Getting facets from resolved promise
227227

228228
```javascript
229-
import { SearchAPI } from "@nickcolley/govuk";
229+
import { SearchAPI } from "govuk-api";
230230
const api = new SearchAPI();
231231
const facets = await api.facets("formats");
232232
console.log(facets);

examples/streaming-content-to-json/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createWriteStream } from "node:fs";
2-
import { ContentAPI, SearchAPI } from "@nickcolley/govuk";
2+
import { ContentAPI, SearchAPI } from "govuk-api";
33
import JSONTransform from "./json-transform.js";
44

55
const query = "Potato";

examples/streaming-content-to-json/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
},
1111
"license": "MIT",
1212
"dependencies": {
13-
"@nickcolley/govuk": "../../"
13+
"govuk-api": "../../"
1414
}
1515
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "module",
3-
"name": "@nickcolley/govuk",
3+
"name": "govuk-api",
44
"description": "JavaScript API client for GOV.UK Content and Search APIs.",
55
"version": "0.0.0-development",
66
"source": "index.js",

0 commit comments

Comments
 (0)