Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

editorconfig

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

editorconfig

EditorConfig File Locator and Interpreter for Node.js

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.9M
increased by4.82%
Maintainers
3
Weekly downloads
 
Created

What is editorconfig?

The editorconfig npm package is used to parse and apply editor configuration from .editorconfig files. These files are designed to maintain consistent coding styles across different editors and IDEs for a project. The package helps in reading the .editorconfig file and applying the configurations to the code editor.

What are editorconfig's main functionalities?

Parse .editorconfig files

This feature allows you to parse an .editorconfig file to retrieve the configurations for a given file path. The parse function returns a promise that resolves with the configuration object.

const editorconfig = require('editorconfig');
editorconfig.parse(filePath).then(config => {
  console.log(config);
});

Parse from a specific position in a file

This feature is useful when you want to get the configuration that applies from a specific line number in a file. It can be helpful when dealing with files that may have different configurations at different positions.

const editorconfig = require('editorconfig');
editorconfig.parse(filePath, { start: lineNumber }).then(config => {
  console.log(config);
});

Generate editor configurations

This feature allows you to generate the contents of an .editorconfig file based on a given configuration object. The generate function returns a promise that resolves with the string content of the .editorconfig file.

const editorconfig = require('editorconfig');
const configs = {
  indent_style: 'space',
  indent_size: 2
};
editorconfig.generate(configs).then(content => {
  console.log(content);
});

Other packages similar to editorconfig

Keywords

FAQs

Package last updated on 02 Jul 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc