vscode-config-resolver
Find configuration for the current file from provided path, workspace, package or HOME directory.
Donate
If you want to thank me, or promote your Issue.
Sorry, but I have work and support for plugins requires some time after work. I will be glad of your support.
Install
$ npm i -S vscode-config-resolver
Why?
- Because many plugins use similar code.
- To simplify work with the configs in plugins.
Usage
const ConfigResolver = ; const configResolver = './path/to/workspace/'; configResolver;
API
.scan(filepath, [options])
Find configuration for the current file.
options
packageProp
- Type:
String
- Default:
null
The property that contains the configuration. Automatically adds the package.json
file to options.configFiles
.
configFiles
- Type:
String[]
- Default:
[]
An array of files that may contain configuration.
editorSettings
- Type:
Object
orString
- Default:
null
Config from editor preferences. Supports:
- Path with
~
- Path with
.
or../
or/
- Object
- Name of predefined config
predefinedConfigs
- Type:
Object
- Default:
{}
If options.editorSettings
contains the name of configuration.
parsers
- Type:
IParser[]
- Default:
js
+json
pattern: /.*$/ parser: JSONparse pattern: /.*$/ parser: requireString
Changelog
See the Releases section of our GitHub project for changelogs for each release version.
License
This software is released under the terms of the MIT license.