npms.io 2.3.8 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/NpmsIO.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare class NpmsIO {
5
5
  constructor(options?: ClientOptions);
6
6
  /**
7
7
  * Set a new API URL.
8
- * @param newUrl The new API url
8
+ * @param newURL The new API url
9
9
  */
10
- setApiUrl(newUrl: string): void;
10
+ setApiUrl(newURL: string): void;
11
11
  }
package/dist/NpmsIO.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NpmsIO = void 0;
4
- const axios_1 = require("axios");
4
+ const api_client_1 = require("@ffflorian/api-client");
5
5
  const api_1 = require("./api");
6
6
  class NpmsIO {
7
7
  constructor(options = {}) {
8
- this.apiClient = axios_1.default.create({ baseURL: options.apiUrl || 'https://api.npms.io/v2' });
8
+ this.apiClient = new api_client_1.APIClient(options.apiUrl || 'https://api.npms.io/v2');
9
9
  this.api = {
10
10
  package: new api_1.PackageAPI(this.apiClient),
11
11
  search: new api_1.SearchAPI(this.apiClient),
@@ -13,10 +13,10 @@ class NpmsIO {
13
13
  }
14
14
  /**
15
15
  * Set a new API URL.
16
- * @param newUrl The new API url
16
+ * @param newURL The new API url
17
17
  */
18
- setApiUrl(newUrl) {
19
- this.apiClient.defaults.baseURL = newUrl;
18
+ setApiUrl(newURL) {
19
+ this.apiClient.setBaseURL(newURL);
20
20
  this.api.package = new api_1.PackageAPI(this.apiClient);
21
21
  this.api.search = new api_1.SearchAPI(this.apiClient);
22
22
  }
@@ -1,8 +1,8 @@
1
- import type { AxiosInstance } from 'axios';
1
+ import type { APIClient } from '@ffflorian/api-client';
2
2
  import type { PackageInfo } from '../interfaces/';
3
3
  export declare class PackageAPI {
4
4
  private readonly apiClient;
5
- constructor(apiClient: AxiosInstance);
5
+ constructor(apiClient: APIClient);
6
6
  /**
7
7
  * Get various packages info.
8
8
  * @param packageNames The package names
@@ -1,8 +1,8 @@
1
- import type { AxiosInstance } from 'axios';
1
+ import type { APIClient } from '@ffflorian/api-client';
2
2
  import type { SearchOptions, SearchResult, SuggestionsOptions } from '../interfaces';
3
3
  export declare class SearchAPI {
4
4
  private readonly apiClient;
5
- constructor(apiClient: AxiosInstance);
5
+ constructor(apiClient: APIClient);
6
6
  /**
7
7
  * Fetch suggestions.
8
8
  * @param query Perform a search query
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "dependencies": {
4
- "axios": "1.12.2"
4
+ "@ffflorian/api-client": "2.1.2"
5
5
  },
6
6
  "description": "A npms.io API client",
7
7
  "devDependencies": {
8
8
  "@types/node": "~24",
9
- "rimraf": "6.0.1",
10
- "typedoc": "0.28.13",
9
+ "rimraf": "6.1.0",
10
+ "typedoc": "0.28.14",
11
11
  "typescript": "5.9.3"
12
12
  },
13
13
  "engines": {
14
- "node": ">= 10.9"
14
+ "node": ">= 21"
15
15
  },
16
16
  "files": [
17
17
  "dist"
@@ -27,12 +27,12 @@
27
27
  "name": "npms.io",
28
28
  "repository": "https://github.com/ffflorian/api-clients/tree/main/packages/npms.io",
29
29
  "scripts": {
30
- "build:ts": "tsc",
31
- "build:docs": "typedoc --options ../../typedoc.json --out ../../docs/packages/npms.io src/index.ts",
30
+ "build:ts": "tsc -p tsconfig.build.json",
31
+ "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/npms.io src/index.ts",
32
32
  "clean": "rimraf dist",
33
33
  "dist": "yarn clean && yarn build:ts",
34
34
  "test": "exit 0"
35
35
  },
36
- "version": "2.3.8",
37
- "gitHead": "2ece1d399cc1f60310ff4dd4daa566df760751ed"
36
+ "version": "2.4.0",
37
+ "gitHead": "b6392f3b78cc68d334526b7ebd5f1375511c769f"
38
38
  }