![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
js-properties-to-json
Advanced tools
Convert Java .properties
files to JSON (using JavaScript).
supports array creation.
The function propertiesToJSON
takes a string and returns
a JavaScript object.
propertiesToJSON(data, {
jsonAsString: false,
convertToJsonTree : false,
parseNumber:false,
parseBooleanNullUndefined:false,
});
node
:const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, 'sample.properties');
const propertiesToJSON = require('properties-to-json');;
fs.readFile(filePath, { encoding: 'utf-8' }, (err, data) => {
if (!err) {
console.log(propertiesToJSON(data));
}
});
import propertiesToJSON from 'js-properties-to-json';
const propsFile = new Request('<link-to-properties-file>');
const props = fetch(propsFile)
.then((response) => {
return response.text();
})
.then((text) => {
const propsText = propertiesToJSON(text);
console.log(propsText);
return propsText;
});
Option | Default value | Description |
---|---|---|
jsonAsString | false | return json as a string |
convertToJsonTree | false | convert properties to json tree eg a.b=c to { "a.b": c } if false or { "a": {"b": c} } |
parseNumber | false | parse value to number e.g - a=1 to { a: "1" } or { a: 1 } |
parseBooleanNullUndefined | false | parse string value of null , true , false , undefined |
Properties | JSON |
---|---|
a=b | { "a": "b" } |
a[1][1]=b | { "a": [ null, [ null, "b" ] ] } |
npm i js-properties-to-json
https://github.com/ryanpcmcquen/propertiesToJSON https://github.com/jeanpaulattard/json-to-properties
FAQs
Convert a Java properties file to JSON (with JavaScript).
The npm package js-properties-to-json receives a total of 64 weekly downloads. As such, js-properties-to-json popularity was classified as not popular.
We found that js-properties-to-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.