![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
@zingle/config
Advanced tools
Readme
The Zingle node-config project provides a way to configure Node.js apps using the environment and command-line arguments.
The Schema class is the entry point into the @zingle/config package. Start by creating a new instance.
import {Schema} from "@zingle/config";
const schema = new Schema();
Use the schema to configure fields which can be set. Fields can have one or more flags which control their behavior.
schema.define("output_file");
schema.define("force", Schema.Flag);
schema.define("input_file", Schema.Required);
Once fields have been defined on the schema, use the .read
method to read the
configuration from the environment and command-line.
const config = schema.read(process.env, process.argv);
Remaining arguments can be found in the .argv
property of the configuration.
if (config.argv.length > 2) { // first two are "node", and the script name
throw new Error(`unexpected argument ${config.argv[2]}`);
}
import fs from "fs";
import {Schema} from "@zingle/config";
const schema = new Schema();
schema.define("output_file");
schema.define("force", Schema.Flag);
schema.define("input_file", Schema.Required);
const config = schema.read(process.env, process.argv);
const input = fs.readFileSync(config.input_file);
const output = processInput(input, config.force);
if (config.output_file) {
fs.writeFileSync(config.output_file, output);
} else {
console.log(output);
}
FAQs
read configuration from environment and CLI args
The npm package @zingle/config receives a total of 0 weekly downloads. As such, @zingle/config popularity was classified as not popular.
We found that @zingle/config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.