Gathering detailed insights and metrics for node-yaml-config
Gathering detailed insights and metrics for node-yaml-config
Gathering detailed insights and metrics for node-yaml-config
Gathering detailed insights and metrics for node-yaml-config
npm install node-yaml-config
Typescript
Module System
Node Version
NPM Version
96.4
Supply Chain
100
Quality
75.5
Maintenance
100
Vulnerability
98.6
License
TypeScript (96.57%)
JavaScript (3.43%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
5,037,626
Last Day
8,029
Last Week
8,029
Last Month
93,366
Last Year
1,193,117
23 Stars
35 Commits
7 Forks
5 Watching
2 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
node-yaml-config@1.0.0
Size
11.15 kB
NPM Version
6.14.15
Node Version
14.17.6
Publised On
30 Sept 2021
Cumulative downloads
Total Downloads
Last day
0%
8,029
Compared to previous day
Last week
-59.1%
8,029
Compared to previous week
Last month
7.2%
93,366
Compared to previous month
Last year
-50.9%
1,193,117
Compared to previous year
Write your configuration files for node.js in yaml
1npm install node-yaml-config
1var yaml_config = require('node-yaml-config'); 2 3var config = yaml_config.load(__dirname + '/config/config.yml'); 4 5console.log(config);
Or with Typescript:
1import { loadAsync } from 'node-yaml-config'; 2 3async function main() { 4 const config = await loadAsync(__dirname + '/config/config.yml'); 5 console.log(config); 6} 7main();
In your configuration file:
1default: 2 server: 3 port: 3000 4 database: 5 host: 'localhost' 6 port: 27017 7development: 8 database: 9 db: 'dev_db' 10test: 11 database: 12 db: 'test_db' 13production: 14 server: 15 port: 8000 16 database: 17 db: 'prod_db' 18 user: 'dbuser' 19 password: 'pass' 20 cache: 21 dir: 'static'
node-yaml-config takes the configuration found in default, then overwrites it with the values found in the environment specific parts. The configuration file is loaded synchronously.
Reads the configuration found in filename
.
Load the configuration found in filename
with the environment based on NODE_ENV
. The environment can be forced with the env
argument.
node-yaml-config keeps parsed yaml files in memory to avoid reading files again.
Reload the configuration found in filename
. Later calls to load
will show the new configuration.
The file is loaded synchronously.
Same as read
but returns a Promise.
Same as load
but returns a Promise.
node-yaml-config keeps parsed yaml files in memory to avoid reading files again.
Same as reload
but returns a Promise.
Copyright (c) 2012-2021 Johann-Michael Thiebaut <johann.thiebaut@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
Found 2/23 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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
29 existing vulnerabilities detected
Details
Score
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 More