Guides, tools and libraries for modern web development.
Installations
npm install @web/config-loader
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Min. Node Version
>=18.0.0
Node Version
20.17.0
NPM Version
10.8.2
Score
99.7
Supply Chain
85.4
Quality
85.1
Maintenance
100
Vulnerability
100
License
Releases
@web/test-runner-saucelabs@0.13.0
Published on 31 Jan 2025
@web/test-runner-saucelabs@0.12.1
Published on 30 Jan 2025
@web/test-runner-saucelabs@0.12.0
Published on 27 Jan 2025
@web/test-runner-browserstack@0.8.0
Published on 27 Jan 2025
@web/test-runner-webdriver@0.9.0
Published on 27 Jan 2025
@web/storybook-builder@0.1.21
Published on 20 Jan 2025
Contributors
Languages
TypeScript (56.57%)
JavaScript (41.06%)
HTML (2.32%)
MDX (0.04%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
10,476,529
Last Day
22,359
Last Week
22,359
Last Month
395,683
Last Year
4,909,775
GitHub Statistics
2,250 Stars
3,008 Commits
298 Forks
24 Watching
57 Branches
146 Contributors
Bundle Size
2.80 kB
Minified
1.13 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.3.2
Package Id
@web/config-loader@0.3.2
Unpacked Size
10.82 kB
Size
3.67 kB
File Count
25
NPM Version
10.8.2
Node Version
20.17.0
Publised On
30 Aug 2024
Total Downloads
Cumulative downloads
Total Downloads
10,476,529
Last day
0%
22,359
Compared to previous day
Last week
-71.5%
22,359
Compared to previous week
Last month
4.1%
395,683
Compared to previous month
Last year
81.9%
4,909,775
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Config Loader
Load user config files for node js projects. Supports loading config as es module or common js module, based on the user's node version, package type and file extension. Prints helpful error messages when invalid syntax combinations are used.
Follows node's logic for deciding how to load a file. .mjs
files are loaded as es module, .cjs
as common js. .js
files are loaded based on the type
field of the package.json.
Usage
1npm i --save-dev @web/config-loader
1import { readConfig, ConfigLoaderError } from '@web/config-loader'; 2// Or as a commonjs module 3// const { readConfig, ConfigLoaderError } = require('@web/config-loader'); 4 5(async () => { 6 try { 7 // will look for: 8 // process.cwd() + 'my-project.config.mjs' 9 // process.cwd() + 'my-project.config.cjs' 10 // process.cwd() + 'my-project.config.js' 11 const config = await readConfig('my-project.config'); 12 } catch (error) { 13 if (error instanceof ConfigLoaderError) { 14 // If the error is a ConfigLoaderError it has a human readable error message 15 // there is no need to print the stack trace. 16 console.error(error.message); 17 return; 18 } 19 console.error(error); 20 return; 21 } 22})();
Custom config file
If you want to let users define a custom config file location, you can pass this as a second optional parameter.
1const { readConfig, ConfigLoaderError } = require('@web/config-loader'); 2 3(async () => { 4 try { 5 const optionalCustomConfigFilePath = '...'; 6 const config = await readConfig('my-project.config', optionalCustomConfigFilePath); 7 } catch (error) { 8 if (error instanceof ConfigLoaderError) { 9 // If the error is a ConfigLoaderError it has a human readable error message 10 // there is no need to print the stack trace. 11 console.error(error.message); 12 return; 13 } 14 console.error(error); 15 return; 16 } 17})();
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no binaries found in the repo
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/canary.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/canary.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/canary.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/canary.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/canary.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/canary.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/canary.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/canary.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/lint.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/lint.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/release.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/release.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-browser.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-browser.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-browser.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-browser.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-node.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-node.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-node.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-node.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/verify-node.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-node.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-node.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-node.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-node.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-node.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/verify-node.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-node.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-storybook-builder.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-storybook-builder.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-storybook-builder.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-storybook-builder.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/verify-storybook-builder.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/modernweb-dev/web/verify-storybook-builder.yml/master?enable=pin
- Info: 0 out of 15 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 6 third-party GitHubAction dependencies pinned
- Info: 7 out of 7 npmCommand dependencies pinned
Reason
Found 3/10 approved changesets -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/canary.yml:1
- Warn: no topLevel permission defined: .github/workflows/lint.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Warn: no topLevel permission defined: .github/workflows/verify-browser.yml:1
- Warn: no topLevel permission defined: .github/workflows/verify-node.yml:1
- Warn: no topLevel permission defined: .github/workflows/verify-storybook-builder.yml:1
- Info: no jobLevel write permissions found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 27 are checked with a SAST tool
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
21 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-r7jx-5m6m-cpg9
- Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-45rm-2893-5f49
- Warn: Project is vulnerable to: GHSA-6vfc-qv3f-vr6c
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-p493-635q-r6gr
- Warn: Project is vulnerable to: GHSA-3965-hpx2-q597
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-54xq-cgqr-rpm3
- Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq
- Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
4
/10
Last Scanned on 2025-02-03
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 MoreOther packages similar to @web/config-loader
cargo-web-loader
In order to use this loader you need to install it by cloning this repository: ``` npm i --save cargo-web-loader ``` and then add it to your webpack config accordingly: ```javascript // Cargo web crate loader { test: /Cargo.toml$/, loaders: [
@iconduit/browserconfig-loader
A Webpack loader for browserconfig.xml files
create-new-webpack-app
CLI for scaffolding webpack projects using default config, framework templates, loader or plugins templates
hybridconfig
Runtime web application configuration loader utilizing hybrid approach: using external JSON config fetching but allowing use of environment variables to overwrite values in development environment.