
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
config-profiler
Advanced tools
Find configuration for the current file from provided path, workspace, package, settings, HOME directory or env variable
Find configuration for the current file from provided path, settings,
package.json, workspace, HOME directory or env variable.
If you want to thank me, or promote your Issue.
Sorry, but I have work and support for plugins and modules requires some time after work. I will be glad of your support or PR's.
$ npm i -S config-profiler
For example, if your config name is "my-cofig" we will search out configuration in the following places and order:
options.settings):
* Return options.settings if they are the object.
* Return config from oprions.predefinedConfigs by name in the options.settings if is a string and it is found.
* Return config from filepath defined in the options.settings.options.envVariableName)options.configFiles
* package.json if you set options.packagePropnull.const ConfigProfiler = require('config-profiler');
const configProfiler = new ConfigProfiler('./path/to/current/workspace', {
configFiles: ['my-super-module-config.json', 'my-super-module-config.js']
});
configProfiler.getConfig('./path/to/current/file').then((result) => {
console.log(result);
// { from: './bla/bla/my-super-module-config.json', config: { ok: true } }
});
const ConfigProfiler = require('config-profiler');
const configProfiler = new ConfigProfiler('./path', {});
Set a new workspace directory path.
configProfiler.setWorkspace('./path/to/workspace');
Set a new options.
configProfiler.setOptions({
configFiles: ['config.json', 'config.js']
});
Get config for the current file path.
configProfiler.getConfig('./path/to/workspace/index.txt').then((result) => {
// console.log(result);
// { from: './path/to/workspace/config.json', config: { ok: true } }
});
settingsObject|StringnullThe settings from the editor or plugin/module options. Can have the object, the name of a predefined config or the path to the config.
{
"predefinedConfigs": { "name": { "ok": true } },
"settings": { "ok": true },
"settings": "name",
"settings": "~/my-module-config.json",
"settings": "../configs/my-module-config.json"
}
Tip
Use
~to refer to HOME directory and./or../to refer to the current workspace (relative). Also you can use absolute path.
predefinedConfigsObject{}Predefined configs. Must have the name of the config, which can be called from options.settings (as string) or options.extendsProp from the options.settings (as object) or found config file.
For example, usage with options.settings:
{
"predefinedConfigs": { "name": { "ok": true } },
"settings": "name"
}
For example, usage with options.extendsProp (extends by default) from found config file:
{
"extends": "name"
}
Predefined config will be merged with config from found config file.
configFilesString[][]The names of the config files that can be used as a configs.
parsersParser[]see belowParsers that will be apply to the found configs. The parser receive the content from the configuration file and returns an object.
{
options: {
parsers: [
// Before applying the parser we check the pattern for the current file
{ pattern: /.*\.yml$/, parser: (text) => mySuperYamlParser(text) }
]
}
}
The Parser interface has the following type:
interface Parser {
pattern: RegExp;
parser: (text: string) => object;
}
useEachParserBooleanfalseAllow to use each parser to config file. Necessary in the case that a single file can have multiple syntaxes. We just ignore the pattern property.
transformFunction(result) => resultA function that returns the result. The result has the following object:
{
from: './path/to/config/file.json', // Also can be 'settings' or 'predefined'
config: { ok: true }
}
packagePropStringnullThe name of property in the package.json file. If you set this option, we'll look for package.json file.
extendsPropStringextendsAllow to use extends property in a configuration file or settings to reference to another configuration file or predefined config.
Use ~ to refer to HOME directory and ./ or ../ to refer to the current workspace (relative). Also you can use absolute path.
Tip
We'll merge config in order from the most deep to the top.
See fixtures/extends directory as an example.
envVariableNameStringnullAllow to get the path to the configuration file from environment variable.
allowHomeDirectoryBooleantrueAllow configs in the HOME directory or not.
See the Releases section of our GitHub project for changelogs for each release version.
This software is released under the terms of the MIT license.
FAQs
Find configuration for the current file from provided path, workspace, package, settings, HOME directory or env variable
We found that config-profiler 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.