# @codic/coffeeconf

> 'CoffeeConf' is a modern configuration system written in CoffeeScript that also supports JS. Only compatible with Node.js, uses ES6 syntax.

Latest version **0.0.5** (published 2020-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codic/coffeeconf
pnpm add @codic/coffeeconf
yarn add @codic/coffeeconf
bun add @codic/coffeeconf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2020-02-24 |
| First published | 2020-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | codic |
| Keywords | configuration, coffeescript, package, tool |

## Links

- npm: https://www.npmjs.com/package/@codic/coffeeconf
- Repository: https://gitlab.com/Gsbhasin84/coffeeconf
- npm.io page: https://npm.io/package/@codic/coffeeconf

## Dependencies (2)

- [js-yaml](https://npm.io/package/js-yaml.md) >=3.13.1
- [shelljs](https://npm.io/package/shelljs.md) >=0.8.3

## Recent versions

- 0.0.5 (latest) — 2020-02-24
- 0.0.4 — 2020-02-24
- 0.0.3 — 2020-02-24
- 0.0.2 — 2020-02-24
- 0.0.1 — 2020-02-24

## README

# CoffeeConf
CoffeeConf is a pleasant library for CoffeeScript and JavaScript running on Node.js. It provides tools for configuration. Note that here I use the JavaScript syntax. 
# Contributing
Feel free to make merge requests, issues, whatever your heart pleases! Note; don't edit package.json. `package.yaml` is autocompiled to `package.json`, so please use that (I like YAML too much, don't I? 😩).
## CoffeeConf - class
Note; instead of using the `new` keyword to use the constructor, you can do `CoffeeConf.access(arg);`. This throws an error if the database doesn't exist; useful for checking if it does (with the `try..catch` construct). Also, use `path.join()` to join paths; works 100%. Note you gotta require path first. JS: `const path = require('path');`. CoffeeScript: `path = require 'path'`

```js
mkcfg('cfgname', 'content', {as_json: false, as_yaml: false, prepend_newline: false, append_newline: false})
```
Creates a new config file `cfgname` with content `content`. The content defaults to an empty string.
If file exists, it is overwritten
Options in the options object literal are self explanatory.
```js
mknested('nesteddirname')
```
This creates a nested directory `nesteddirname` inside your database.

```js
readcfg('filename', {as_json: false, as_yaml: false, prepend_newline: false, append_newline: false})
```
Reads a config file `filename`.
Options in the options object literal are self explanatory.

```js
rmcfg('filename')
```
Removes the configuration file `filename` in your database.
```js
rmdb()
```
Simply removes the whole database that this is called on. 

```js
rmnested('nesteddirname')
```
Removes a nested directory `nesteddirname` inside your database.

```js
writecfg('cfgname', 'content', {as_json: false, as_yaml: false, prepend_newline: true, append_newline: false})
```
Creates a new config file `cfgname` with content `content`. The content defaults to an empty string.
If file already exists, it is appended to. Please use mkcfg to make new files.

Options in the options object literal are self explanatory.

```js
exist('filename')
```
Returns a boolean (true/false) based on if the file `filename` exists in your database or not.

---
_Source: https://npm.io/package/@codic/coffeeconf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
