From 60a5256241cd51ff177734d6ac83b3d30e3a7ceb Mon Sep 17 00:00:00 2001 From: Anna Bocharova Date: Thu, 3 Oct 2024 19:20:14 +0000 Subject: [PATCH] Ref: making those peers optional, only needed for those using TypeScript. --- README.md | 6 ++++-- package.json | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f40294..6d77cb2 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,15 @@ This project is available as a [NPM package][npm-url]. ```bash -$ npm install node-mocks-http @types/node @types/express --save-dev +$ npm install node-mocks-http --save-dev +$ npm install @types/node @types/express --save-dev # when using TypeScript ``` or ```bash -$ yarn add node-mocks-http @types/node @types/express --dev +$ yarn add node-mocks-http --dev +$ yarn add @types/node @types/express --dev # when using TypeScript ``` After installing the package include the following in your test files: diff --git a/package.json b/package.json index 067c3dc..65ed85c 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,14 @@ "@types/express": "^4.17.21 || ^5.0.0", "@types/node": "*" }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + }, + "@types/node": { + "optional": true + } + }, "devDependencies": { "@types/chai": "^4.3.11", "@types/mocha": "^10.0.6",