Gathering detailed insights and metrics for nock-knock
Gathering detailed insights and metrics for nock-knock
Gathering detailed insights and metrics for nock-knock
Gathering detailed insights and metrics for nock-knock
npm install nock-knock
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
4 Commits
2 Watchers
2 Branches
1 Contributors
Updated on Mar 18, 2019
Latest Version
2.0.0
Package Id
nock-knock@2.0.0
Unpacked Size
5.86 kB
Size
2.01 kB
File Count
6
NPM Version
6.0.0
Node Version
8.9.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This module scratches some of my itches. When I define mocks I want to use URL
params in the URL instead of writing regexp's or manually creating functions
that do the path validation. So in modules uses the routable
module to
constructor a route with params, then returns a function that validates if
received URL is accepted by routable
. If there are params defined and we have
validators for it, we will execute those so you can still deny specific paths.
npm install --save nock-knock
Who's there?
Import the module, give it an URL and pass it in the nock methods:
1import route from 'nock-knock'; 2import nock from 'nock'; 3 4nock('https://example.com') 5.get(route('/url/:param/another')) 6.reply(200, 'another');
If you want to validate params you can supply an object as second argument. The keys in the object should match the name of the param:
1nock('https://example.com') 2.get(route('/url/:foo/bar', { 3 foo: function validate(value) { 4 return value === 'bar' 5 } 6})) 7 8// Intercepts /url/bar/bar
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
4 existing vulnerabilities detected
Details
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More