Installations
npm install grunt-properties-reader
Score
47.7
Supply Chain
91.6
Quality
72.5
Maintenance
25
Vulnerability
98.2
License
Releases
Unable to fetch releases
Developer
slawrence
Developer Guide
Module System
CommonJS
Min. Node Version
>= 0.8.0
Typescript Support
No
Node Version
NPM Version
1.3.9
Statistics
5 Stars
13 Commits
7 Forks
3 Watching
1 Branches
4 Contributors
Updated on 15 Sept 2018
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
389,904
Last day
9.9%
133
Compared to previous day
Last week
0.9%
640
Compared to previous week
Last month
16.2%
2,657
Compared to previous month
Last year
-29.9%
28,454
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
Dev Dependencies
4
grunt-properties-reader
Grunt plugin that reads java properties files.
Getting Started
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
1npm install grunt-properties-reader --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
1grunt.loadNpmTasks('grunt-properties-reader');
The "properties" task
Overview
In your project's Gruntfile, add a section named properties
to the data object passed into grunt.initConfig()
.
1grunt.initConfig({
2 properties: {
3 props: 'configFile.properties'
4 }
5});
Options
Options are passed directly into the second argument of the grunt.file.read
operation. See grunt.file
Usage Examples
Basic
In this example, a properties file is used to read a server deployment location. The deployDir
property is then used in a clean task.
The example application.properties
file:
1deployDir=C:\server\deployment
And example Gruntfile.js
:
1grunt.initConfig({
2 properties: {
3 app: 'application.properties'
4 },
5 clean: {
6 deployDir: '<%= app.deployDir %>'
7 }
8})
9
10grunt.loadNpmTasks('grunt-contrib-clean');
11grunt.loadNpmTasks('grunt-properties-reader');
12
13grunt.registerTask('cleanDeploy', ['properties', 'clean:deployDir'])
Running grunt cleanDeploy
from the command line will delete the directory.
Multiple Files
In this example, multiple properties files are read in the order specified. Values from subsequent files are merged with those from the proceeding. Therefore, values from proceeding files will overwrite those from the preceeding files. Consider the following properties files:
1deployDir=C:\server\deployment
1deployDir=/opt/server 2debug=true
1grunt.initConfig({
2 properties: {
3 app: [ 'default.properties', 'overrides.properties' ]
4 },
5 clean: {
6 deployDir: '<%= app.deployDir %>'
7 }
8})
9
10grunt.loadNpmTasks('grunt-contrib-clean');
11grunt.loadNpmTasks('grunt-properties-reader');
12
13grunt.registerTask('cleanDeploy', ['properties', 'clean:deployDir'])
When executed, the app variable will contain the following values:
1{ 2 deployDir=/opt/server 3 debug=true 4}
Finally, when using multiple files, the first file in the list must be present. All subsequent files are optional, and will not cause the task to fail if they are not present.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
- 2013-06-07 v0.1.0 Initial release
- 2013-07-30 v0.1.1 Non greedy equals (thanks @nuarhu)
- 2014-03-11 v0.1.2 Multiple properties file support (thanks @jburwell)
- 2014-04-13 v0.1.3 Bug fix & multi-line support (thanks @hemdada & @bostaunieux)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE-MIT:0
- Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0
Reason
Found 4/13 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
project is not fuzzed
Details
- Warn: no fuzzer integrations 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 4 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2024-11-18
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