
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
formerly node-config-python
Read and write python config files non-destructively (preserves comments and line-order)
Turns this kind of thing:
foo = True
bar = None
baz = whatever
qux = apples,bananas
Into this kind of thing:
{ foo: true
, bar: null
, baz: "whatever"
, qux: ["apples", "bananas"]
}
(comments are stored in meta-data keys __lines
and __keys
)
npm install --save pyconf
var pyconf = require('pyconf');
// alias for fs.readFile() then pyconf.parse()
pyconf.readFile("/path/to/foo.conf", function (err, obj) {
console.log(obj);
});
// alias for pyconf.stringify() then safeReplace.writeFile()
pyconf.writeFile("/path/to/foo.conf", obj, function (err, obj) {
console.log("wrote file");
});
Note: the writeFile
function uses safe-replace
so that it will work even in environments where race conditions are possible and will also create a backup file whatever.conf.bak
of the config being overwritten.
pyconf
.parse(str, cb) // => err, object
.stringify(obj, cb) // => err, text
.readFile(filename, cb) // => err, object
.writeFile(filename, obj, cb) // => err
FAQs
Read and write python config files non-destructively (preserves comments)
The npm package pyconf receives a total of 3,947 weekly downloads. As such, pyconf popularity was classified as popular.
We found that pyconf 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.