Socket
Socket
Sign inDemoInstall

vscode-get-config

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vscode-get-config

A simple wrapper for `vscode.workspace.getConfiguration()` provided by the Visual Studio Code API


Version published
Weekly downloads
10
increased by100%
Maintainers
1
Install size
1.03 MB
Created
Weekly downloads
 

Readme

Source

vscode-get-config

npm npm CircleCI David

A simple wrapper for vscode.workspace.getConfiguration() provided by the Visual Studio Code API

Features:

  • supports dot notation
  • supports variable substitution

Note: By default, variable substitution is supported only by a handful of settings (see details)

Installation

npm install vscode-get-config -S

Usage

getConfig(section?: string)

Example:

import { getConfig } from 'vscode-get-config';

const { fontFamily, fontSize } = await getConfig('editor');
const fontConfig = await getConfig('editor.fontFamily', 'editor.fontSize');

Variable Substitution

Most of Visual Studio Code's variables will be substituted used in a configuration value

  • all predefined variables

    • ${workspaceFolder}
    • ${workspaceFolderBasename}
    • ${file}
    • ${relativeFile}
    • ${relativeFileDirname}
    • ${fileBasename}
    • ${fileBasenameNoExtension}
    • ${fileDirname}
    • ${fileExtname}
    • ${cwd}
    • ${lineNumber}
    • ${selectedText}
    • ${execPath}
    • ${pathSeparator}
    • ${defaultBuildTask}
  • environment variables, e.g. ${env:USERNAME}

  • configuration variables, e.g. ${config:editor.fontSize}

License

This work is licensed under The MIT License

Keywords

FAQs

Last updated on 27 Dec 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc