Gathering detailed insights and metrics for webtask-require-version
Gathering detailed insights and metrics for webtask-require-version
Gathering detailed insights and metrics for webtask-require-version
Gathering detailed insights and metrics for webtask-require-version
Override require so you can test your webtask.io scripts.
npm install webtask-require-version
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
11 Commits
2 Watchers
1 Branches
2 Contributors
Updated on Jan 28, 2023
Latest Version
1.0.1
Package Id
webtask-require-version@1.0.1
Size
4.14 kB
NPM Version
2.13.1
Node Version
0.10.40
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
6
Override require
so you can test your webtask.io scripts.
npm install webtask-require-version
webtask.io only allows specific versions of modules to be used. When writing my webtasks I wanted to test against those same specific versions (mocking depedencies manually). This module does that by overriding require
to make the require('module@x.y.z')
syntax valid.
your-webtask.js
1var request = require('request@2.56.0') 2var qs = require('qs@3.1.0') 3var _ = require('lodash@3.9.3') 4 5module.exports = function (ctx, cb) { 6 // Use request, qs, and lodash in your webtask 7}
test.js
1// This overrides the default `require` 2require('webtask-require-version') 3 4// Your webtask can now use use requires like require('request@2.56.0') 5var webtask = require('./your-webtask') 6 7// Other requires will still work 8require('tape')(function (t) { 9 // Test your webtask 10 webtask(context, function (err, data) { 11 t.equal(data, expected) 12 t.end(); 13 }) 14})
webtask-require-version
will throw an error if you try to require a module that does not match based on the semver ^
operator. It will also log a warning if semver
does match but the versions dont match exactly. This warning can be suppressed by using NODE_ENV=production
.
This is written in ES6 and compiled to ES5 using babel
. The code you require will come from the lib/
directory which gets compiled from src/
before each npm publish
.
npm test
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/6 approved changesets -- score normalized to 3
Reason
project is archived
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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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