An open API service indexing awesome lists of open source software.

https://github.com/savagecore/node-apache2-conf-formatter

A javascript port of https://github.com/bearx3f/a2conf - basic formatting
https://github.com/savagecore/node-apache2-conf-formatter

Last synced: 9 months ago
JSON representation

A javascript port of https://github.com/bearx3f/a2conf - basic formatting

Awesome Lists containing this project

README

          

# apache2-conf-formatter [![Build Status](https://img.shields.io/github/workflow/status/SavageCore/node-apache2-conf-formatter/test)](https://github.com/SavageCore/node-apache2-conf-formatter/actions/workflows/npm-test.yml)
[![Codecov](https://img.shields.io/codecov/c/github/SavageCore/node-apache2-conf-formatter.svg?style=flat-square)](https://codecov.io/gh/SavageCore/node-apache2-conf-formatter/)

> Format apache2 configuration files

## Install

```
$ npm install apache2-conf-formatter
```

## Usage

```js
const apache2ConfFormatter = require('apache2-conf-formatter');

console.log(apache2ConfFormatter.format('httpd.conf'));
//=> Promise the formatted configuration file
```

## API

### format(path, [options])

Format the given file

**arguments:**
`path` the path to file.
`options` (optional) `Object` see [options](#options)

**returns:**
`Promise` \ the formatted configuration file

#### options

##### useTabs

Type: `boolean`

Default: `false`

Indent lines with tabs instead of spaces

##### tabWidth

Type: `number`

Default: `2`

Specify the number of spaces/tabs per indentation-level

## License

MIT © [SavageCore](https://savagecore.eu)