Gathering detailed insights and metrics for @webpack-contrib/schema-utils
Gathering detailed insights and metrics for @webpack-contrib/schema-utils
Gathering detailed insights and metrics for @webpack-contrib/schema-utils
Gathering detailed insights and metrics for @webpack-contrib/schema-utils
npm install @webpack-contrib/schema-utils
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (99.9%)
Shell (0.1%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
250 Stars
200 Commits
39 Forks
10 Watchers
3 Branches
88 Contributors
Updated on Jun 26, 2025
Latest Version
1.0.0-beta.0
Package Id
@webpack-contrib/schema-utils@1.0.0-beta.0
Size
6.88 kB
NPM Version
5.6.0
Node Version
8.11.1
Published on
Apr 02, 2018
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
1
25
Webpack Schema Validation Utilities
Validates options
objects against a JSON Schema and
displays the output beautifully.
This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.
To begin, you'll need to install schema-utils
:
1$ npm install @webpack-contrib/schema-utils --save-dev
When using the API directly, the main entry point is the serve
function, which
is the default export of the module.
1const validate = require('@webpack-contrib/schema-utils'); 2const schema = require('path/to/schema.json'); 3const target = { ... }; // the options object to validate 4const name = '...'; // the load or plugin name validate() is being used in 5 6validate({ name, schema, target });
Returns true
if validation succeeded, false
validation failed and options
allow the function to return a value. (see options below).
Type: Object
Options for initializing and controlling the server provided. The option names
listed below belong to the options
object.
exit
Type: Boolean
Default: false
If true
, will instruct the validator to end the process with an error code of
1
.
log
Type: Boolean
Default: false
If true
, will instruct the validator to log the results of the validation (in
the event of a failure) in a
webpack-style log output. This
is typically used with throw: false
.
name
Type: String
Default: undefined
Required
A String
specifying the name of the loader or plugin utilizing the validator.
schema
Type: String|Object
Default: undefined
Required
A String
specifying the filesystem path to the schema used for validation.
Alternatively, you may specify an object
containing the JSON-parsed schema.
target
Type: Object
Default: undefined
Required
An Object
containing the options to validate against the specified schema.
throw
Type: Boolean
Default: true
By default the validator will throw an error and display validation results upon
failure. If this option is set to false
, the validator will not throw an error.
This is typically used in situations where a return value of false
for
validate()
is sufficient, a stack trace is uneeded, or when
webpack-style log output is
preferred.
Below is a basic example of how this validator might be used:
1# schema.json 2{ 3 "type": "object", 4 "properties": { 5 "name": { 6 "type": "string" 7 }, 8 "test": { 9 "anyOf": [ 10 { "type": "array" }, 11 { "type": "string" }, 12 { "instanceof": "RegExp" } 13 ] 14 }, 15 "transform": { 16 "instanceof": "Function" 17 }, 18 "sourceMap": { 19 "type": "boolean" 20 } 21 }, 22 "additionalProperties": false 23}
1const { getOptions } = require('loader-utils'); 2const validate = require('@webpack-contrib/schema-utils'); 3 4import schema from 'path/to/schema.json' 5 6function loader (src, map) { 7 const options = getOptions(this) || {}; 8 9 validate({ name: 'Loader Name', schema, target: options }); 10 11 // Code... 12}
1const validate = require('@webpack-contrib/schema-utils'); 2const schema = require('path/to/schema.json'); 3 4class Plugin { 5 constructor (options) { 6 validate({ name: 'Plugin Name', schema, target: options }); 7 8 this.options = options; 9 } 10 11 apply (compiler) { 12 // Code... 13 } 14}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
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